Skip to content

Instantly share code, notes, and snippets.

@pekochan069
pekochan069 / qlock.py
Last active June 18, 2024 12:57
qlock python bad implementation
from time import sleep
from datetime import datetime as d
def C(c,a):return a+c+"\x1b[0m"
a=open(__file__).read().replace(":\n",":").replace("\n",";").replace(" ","")
while 1:
c=d.now().strftime("%H:%M:%S")
for i in range(len(a)//64):
for j in range(64):
e=int((j/2)%4)
print(C(a[i*64+j],"\x1b[40;37;1m"if i>4 or e==3 or~[31599,19812,14479,31207,23524,29411,29679,30866,31727,31719,1040][10 if c[j//8]==":"else int(c[j//8])]>>(12-i*3+e)&1 else"\x1b[47;30;1m"), end="")
@pekochan069
pekochan069 / forge_dynamic_thresholding.py
Created March 19, 2024 17:04
sd-webui-forge dynamic thresholding xyz implementation (not fully tested)
from functools import partial
from random import choice
from typing import Any
import sys
import traceback
import gradio as gr
from modules import scripts, script_callbacks
from lib_dynamic_thresholding.dynthres_core import DynThresh
from lib_dynamic_thresholding.dynthres import DynamicThresholdingNode
iom, blonde hair, long hair, dress, virtual youtuber, bangs, blue eyes, looking at viewer, bare shoulders, choker, halterneck, gloves, blue dress, multicolored hair, gradient hair, jewelry, smile, breasts, black gloves, criss-cross halter, earrings, blush, collarbone, hair ornament, halter dress, lace choker, black choker, frills, bow, blue hair, very long hair, flower, closed mouth, hair flower, black bow, lace trim, lace, upper body, medium breasts, open mouth, hairclip, frilled dress, fishnets, sleeveless, thighhighs, fishnet thighhighs, single thighhigh, thigh strap, black dress, hand up, sleeveless dress, large breasts, cowboy shot, cleavage, holding, parted lips, :d, green hair, blunt bangs, sitting, watson amelia, indoors, official alternate costume, petals, from side, skirt, armpits, outdoors, teeth, plaid, hair flaps, lying, sky, waist bow, black footwear, black thighhighs, on back, floating hair, bare arms, blurry, hands up, plaid skirt, hand on own chest
iom : 178
blonde hair : 178
long hair : 17
import os
import glob
from collections import Counter
files_path = "./tags2"
save_path = "./tags2/fixed"
ext = "txt"
len_ext = len(ext) + 1
remove_list = ["emataso1"]
add_list = ["iom", "virtual youtuber", "dress"]
# @title ## **1.2. Download SDXL**
import os
import re
import json
import glob
import gdown
import requests
import subprocess
from IPython.utils import capture
from urllib.parse import urlparse, unquote
# pip install Pillow
from PIL import Image
tags = "1girl, solo, pink hair, blue eyes, short hair, looking at viewer, long sleeves, closed mouth, bangs, hair between eyes, breasts, jacket, shirt, looking back, black shirt, medium breasts"
formatted_tags = tags.replace(", ", ";")
image = Image.open("1.png")
exif = image.getexif()
exif[0x9C9E] = formatted_tags.encode("utf-16")
{
"TUNNEL": "ngrok",
"NGROK_API_TOKEN": "ngrok_토큰"
}