Delete app.py
Browse files
app.py
DELETED
|
@@ -1,366 +0,0 @@
|
|
| 1 |
-
import spaces # oltava ensimmäisenä!
|
| 2 |
-
|
| 3 |
-
import torch
|
| 4 |
-
from diffusers import StableDiffusionXLPipeline
|
| 5 |
-
import gradio as gr
|
| 6 |
-
import random
|
| 7 |
-
import re
|
| 8 |
-
|
| 9 |
-
model_id = "kkntr/sdxl-kkntr"
|
| 10 |
-
|
| 11 |
-
pipe = StableDiffusionXLPipeline.from_pretrained(
|
| 12 |
-
model_id,
|
| 13 |
-
torch_dtype=torch.float16,
|
| 14 |
-
use_safetensors=True
|
| 15 |
-
).to("cuda")
|
| 16 |
-
|
| 17 |
-
# --- Rekisteröidään pysyvät LoRAt ADAPTEREINA (ei painoja vielä) ---
|
| 18 |
-
PERSISTENT_LORAS = {
|
| 19 |
-
"base1": ("kkntr/lora1", 0.2), # oletuspaino; muutettavissa generate():ssa
|
| 20 |
-
"base2": ("kkntr/lora2", 0.3),
|
| 21 |
-
"base3": ("kkntr/lora12", 0.4),
|
| 22 |
-
"base4": ("kkntr/lora10", 0.1),
|
| 23 |
-
}
|
| 24 |
-
for name, (repo, _) in PERSISTENT_LORAS.items():
|
| 25 |
-
pipe.load_lora_weights(repo, adapter_name=name)
|
| 26 |
-
|
| 27 |
-
# --- Rekisteröidään tyyli-LoRAt ADAPTEREINA (ei painoja vielä) ---
|
| 28 |
-
STYLE_LORAS = {
|
| 29 |
-
"None": (None, 0.0, "", None),
|
| 30 |
-
"Foreskin play": ("kkntr/lora5", 1.0, "foreskin insertion", "style_fp"),
|
| 31 |
-
"Cum through clothing": ("kkntr/lora6", 1.0, "cum in clothing", "style_cc"),
|
| 32 |
-
"Penis through leghole": ("kkntr/lora7", 1.0, "detailed bulge", "shorts", "style_ptl"),
|
| 33 |
-
"Frottage": ("kkntr/lora8", 1.0, "byfrottage, frottage"),
|
| 34 |
-
"Penis towards viewer": ("kkntr/lora9", 1.0, "penis_towards_viewer", "style_ptv"),
|
| 35 |
-
"Foreskin play closeup": ("kkntr/lora11", 1.0, "ZonkFS, close-up, furry, anthro, faceless male, penis, foreskin, fellatio, oral, foreskin kiss, foreskin play, side view, steam", "style_fscl"),
|
| 36 |
-
}
|
| 37 |
-
for key, spec in STYLE_LORAS.items():
|
| 38 |
-
repo = spec[0]
|
| 39 |
-
adapter_name = spec[3]
|
| 40 |
-
if repo and adapter_name:
|
| 41 |
-
pipe.load_lora_weights(repo, adapter_name=adapter_name)
|
| 42 |
-
|
| 43 |
-
scratchpad = {
|
| 44 |
-
"animal": [
|
| 45 |
-
"kangaroo", "otter", "tiger", "lion", "wolf", "fox", "polar bear", "deer", "reindeer", "hyena", "bull",
|
| 46 |
-
"rabbit", "panther", "moose", "cheetah", "badger", "striped hyena", "rat", "leopard", "thylacine", "bighorn sheep",
|
| 47 |
-
"zebra", "horse", "donkey", "unicorn", "white unicorn", "alligator", "western dragon", "lizard", "crocodile", "theropod",
|
| 48 |
-
"kangaroo", "otter", "tiger", "lion", "wolf", "fox", "polar bear", "deer", "reindeer", "hyena", "bull",
|
| 49 |
-
"rabbit", "panther", "moose", "cheetah", "badger", "striped hyena", "rat", "leopard", "thylacine", "bighorn sheep",
|
| 50 |
-
"zebra", "horse", "donkey", "unicorn", "white unicorn", "alligator", "western dragon", "lizard", "crocodile", "theropod",
|
| 51 |
-
"kangaroo", "otter", "tiger", "lion", "wolf", "fox", "polar bear", "deer", "reindeer", "hyena", "bull",
|
| 52 |
-
"rabbit", "panther", "moose", "cheetah", "badger", "striped hyena", "rat", "leopard", "thylacine", "bighorn sheep",
|
| 53 |
-
"zebra", "horse", "donkey", "unicorn", "white unicorn", "alligator", "western dragon", "lizard", "crocodile", "theropod",
|
| 54 |
-
"black russian terrier", "pit bull", "schnauzer", "dobermann", "mastiff", "molosser", "pinscher", "rottweiler", "tamaskan dog",
|
| 55 |
-
"wolfdog", "alaskan husky", "alaskan malamute", "canadian eskimo dog", "german shepherd", "labrador husky", "siberian husky",
|
| 56 |
-
"labrador", "golden retriever", "dalmatian", "border collie", "collie", "herding dog", "pastoral dog", "sheepdog",
|
| 57 |
-
"carolina dog", "rhodesian ridgeback", "nordic sled dog", "spitz", "husky", "akita", "mountain dog", "primitive dog",
|
| 58 |
-
"siberian retriever", "hunting dog", "australian cattle dog", "crash bandicoot", "montgomery gator, fnaf", "bear",
|
| 59 |
-
],
|
| 60 |
-
"pose": [
|
| 61 |
-
"flexing", "muscle flex", "pinup pose", "victory pose", "squatting", "crouching",
|
| 62 |
-
"reclining", "lying", "lying on back", "lying on stomach", "lying on side",
|
| 63 |
-
"sitting", "sitting cross-legged", "sitting on edge", "leaning", "lounging",
|
| 64 |
-
"hands behind head", "hands on hips", "arms crossed", "arms raised", "arms behind back",
|
| 65 |
-
"jumping", "running pose", "walking pose", "sprinting", "mid-air pose", "push-up position", "plank position", "yoga pose",
|
| 66 |
-
"stretching", "twisting torso", "bending forward", "side bend", "backbend",
|
| 67 |
-
"hands in pockets", "hands on knees", "hands on thighs", "arms extended", "arms flexed",
|
| 68 |
-
"looking over shoulder", "looking up", "looking down", "looking straight", "gaze at camera",
|
| 69 |
-
"hands clasped", "hands together", "resting chin on hand", "leaning on wall",
|
| 70 |
-
"casual pose", "relaxed pose", "confident pose", "triumphant pose",
|
| 71 |
-
"athletic pose", "dynamic pose", "action pose", "defensive stance",
|
| 72 |
-
"martial arts pose", "superhero pose", "dramatic pose",
|
| 73 |
-
],
|
| 74 |
-
"swimwear": [
|
| 75 |
-
"swimming trunks", "swimming shorts", "swim briefs", "speedo", "bermuda shorts", "swim thong", "athletic swim shorts", "compression swim shorts",
|
| 76 |
-
],
|
| 77 |
-
"headwear": [
|
| 78 |
-
"baseball cap", "backwards cap", "snapback", "trucker hat",
|
| 79 |
-
"beanie", "knit cap", "watch cap", "skullcap",
|
| 80 |
-
"bandana", "headband", "sweatband",
|
| 81 |
-
"visor", "bucket hat", "sun hat",
|
| 82 |
-
"cowboy hat", "straw hat", "fedora", "trilby",
|
| 83 |
-
"flat cap", "newsboy cap", "beret",
|
| 84 |
-
"military cap", "officer cap", "camouflage helmet", "combat helmet",
|
| 85 |
-
"motorcycle helmet", "bike helmet", "hard hat", "construction helmet",
|
| 86 |
-
"hood", "hoodie hood", "cowl",
|
| 87 |
-
"crown", "circlet", "horned helmet", "samurai helmet", "viking helmet",
|
| 88 |
-
],
|
| 89 |
-
"setting": [
|
| 90 |
-
"bedroom", "living room", "locker room", "gym", "shower room",
|
| 91 |
-
"bathroom", "sauna", "kitchen", "garage", "workshop", "basement",
|
| 92 |
-
|
| 93 |
-
"beach", "swimming pool", "hot tub", "lake", "waterfall", "forest",
|
| 94 |
-
"mountains", "cave", "desert", "snowy landscape", "tundra",
|
| 95 |
-
|
| 96 |
-
"city street", "alleyway", "rooftop", "nightclub", "bar", "concert stage",
|
| 97 |
-
"festival", "arcade", "skate park", "basketball court", "football field",
|
| 98 |
-
"stadium", "boxing ring", "wrestling ring",
|
| 99 |
-
|
| 100 |
-
"office", "warehouse", "factory", "construction site", "train station",
|
| 101 |
-
"subway", "parking lot", "gas station", "motel room", "hotel lobby",
|
| 102 |
-
|
| 103 |
-
"campfire", "tent", "cabin", "dorm room", "classroom",
|
| 104 |
-
"library", "museum", "gallery",
|
| 105 |
-
],
|
| 106 |
-
"hair": [
|
| 107 |
-
"short hair", "medium hair", "crew cut", "buzz cut", "flat top",
|
| 108 |
-
"undercut", "slicked back hair", "side part", "center part",
|
| 109 |
-
"pompadour", "quiff", "spiky hair", "messy hair",
|
| 110 |
-
"mohawk", "faux hawk",
|
| 111 |
-
"man bun", "top knot", "low bun",
|
| 112 |
-
],
|
| 113 |
-
"accessories": [
|
| 114 |
-
"chain necklace", "dog tag necklace", "leather bracelet", "wristband",
|
| 115 |
-
"watch", "ring", "earring", "stud earring", "hoop earring",
|
| 116 |
-
"septum piercing", "nose ring", "eyebrow piercing", "lip piercing",
|
| 117 |
-
"tongue piercing", "fingerless gloves", "leather gloves",
|
| 118 |
-
"armband", "bandana", "headband", "sunglasses", "aviator sunglasses", "cap", "beanie", "backwards cap", "finger rings", "spiked bracelet", "spiked collar", "chain belt",
|
| 119 |
-
"pendant necklace", "cuff bracelet", "knuckle rings",
|
| 120 |
-
],
|
| 121 |
-
"hairy": [
|
| 122 |
-
"chest hair", "belly tuft", "happy trail", "armpit hair", "facial hair",
|
| 123 |
-
"beard", "mustache", "goatee", "soul patch", "sideburns", "hairy arms",
|
| 124 |
-
"hairy legs", "hairy back", "full body hair",
|
| 125 |
-
|
| 126 |
-
"chest hair, belly tuft", "chest hair, happy trail", "chest hair, armpit hair",
|
| 127 |
-
"chest hair, facial hair", "chest hair, beard", "chest hair, mustache", "chest hair, goatee",
|
| 128 |
-
"chest hair, soul patch", "chest hair, sideburns", "chest hair, hairy arms",
|
| 129 |
-
"chest hair, hairy legs", "chest hair, hairy back",
|
| 130 |
-
|
| 131 |
-
"belly tuft, happy trail", "belly tuft, armpit hair", "belly tuft, facial hair",
|
| 132 |
-
"belly tuft, beard", "belly tuft, mustache", "belly tuft, goatee", "belly tuft, soul patch",
|
| 133 |
-
"belly tuft, sideburns", "belly tuft, hairy arms", "belly tuft, hairy legs", "belly tuft, hairy back",
|
| 134 |
-
|
| 135 |
-
"happy trail, armpit hair", "happy trail, facial hair", "happy trail, beard",
|
| 136 |
-
"happy trail, mustache", "happy trail, goatee", "happy trail, soul patch",
|
| 137 |
-
"happy trail, sideburns", "happy trail, hairy arms", "happy trail, hairy legs", "happy trail, hairy back",
|
| 138 |
-
|
| 139 |
-
"armpit hair, facial hair", "armpit hair, beard", "armpit hair, mustache",
|
| 140 |
-
"armpit hair, goatee", "armpit hair, soul patch", "armpit hair, sideburns",
|
| 141 |
-
"armpit hair, hairy arms", "armpit hair, hairy legs", "armpit hair, hairy back",
|
| 142 |
-
|
| 143 |
-
"facial hair, beard", "facial hair, mustache", "facial hair, goatee",
|
| 144 |
-
"facial hair, soul patch", "facial hair, sideburns", "facial hair, hairy arms",
|
| 145 |
-
"facial hair, hairy legs", "facial hair, hairy back",
|
| 146 |
-
|
| 147 |
-
"beard, mustache", "beard, goatee", "beard, soul patch", "beard, sideburns",
|
| 148 |
-
"beard, hairy arms", "beard, hairy legs", "beard, hairy back",
|
| 149 |
-
|
| 150 |
-
"mustache, goatee", "mustache, soul patch", "mustache, sideburns",
|
| 151 |
-
"mustache, hairy arms", "mustache, hairy legs", "mustache, hairy back",
|
| 152 |
-
|
| 153 |
-
"goatee, soul patch", "goatee, sideburns", "goatee, hairy arms",
|
| 154 |
-
"goatee, hairy legs", "goatee, hairy back",
|
| 155 |
-
|
| 156 |
-
"soul patch, sideburns", "soul patch, hairy arms", "soul patch, hairy legs", "soul patch, hairy back",
|
| 157 |
-
|
| 158 |
-
"sideburns, hairy arms", "sideburns, hairy legs", "sideburns, hairy back",
|
| 159 |
-
|
| 160 |
-
"hairy arms, hairy legs", "hairy arms, hairy back", "hairy legs, hairy back",
|
| 161 |
-
|
| 162 |
-
"chest hair, belly tuft, happy trail", "chest hair, belly tuft, beard",
|
| 163 |
-
"chest hair, happy trail, beard", "chest hair, armpit hair, beard",
|
| 164 |
-
"chest hair, armpit hair, mustache", "chest hair, armpit hair, goatee",
|
| 165 |
-
"chest hair, facial hair, beard", "chest hair, facial hair, mustache",
|
| 166 |
-
"chest hair, facial hair, goatee", "chest hair, hairy arms, beard",
|
| 167 |
-
"chest hair, hairy legs, beard", "chest hair, hairy back, beard",
|
| 168 |
-
|
| 169 |
-
"full body hair, chest hair", "full body hair, beard", "full body hair, armpit hair",
|
| 170 |
-
"full body hair, happy trail", "full body hair, facial hair"
|
| 171 |
-
,
|
| 172 |
-
],
|
| 173 |
-
"body": [
|
| 174 |
-
"skinny", "underweight", "slim", "lean", "fit", "athletic", "toned", "muscular",
|
| 175 |
-
"big muscles", "hyper muscles", "bodybuilder", "buff", "beefy", "manly", "masculine",
|
| 176 |
-
"stocky", "broad-shouldered", "medium build", "average build", "dad body",
|
| 177 |
-
"big body", "heavyset", "obese", "large frame", "solid build", "powerful build",
|
| 178 |
-
"athletic, muscular", "athletic, toned", "muscular, big body", "buff, muscular",
|
| 179 |
-
"beefy, big body", "stocky, muscular", "broad-shouldered, muscular",
|
| 180 |
-
"average build, toned", "manly, muscular", "masculine, buff", "bodybuilder, big muscles",
|
| 181 |
-
"lean, muscular", "fit, muscular", "toned, muscular", "athletic, big muscles",
|
| 182 |
-
"muscular, beefy", "stocky, strong", "broad-shouldered, fit", "medium build, muscular",
|
| 183 |
-
"dad body, big body", "heavyset, muscular", "obese, strong", "powerful build, muscular",
|
| 184 |
-
"solid build, athletic", "large frame, muscular", "buff, manly", "beefy, masculine",
|
| 185 |
-
"athletic, solid build", "lean, fit", "toned, fit", "muscular, manly", "big muscles, masculine",
|
| 186 |
-
],
|
| 187 |
-
"underwear": [
|
| 188 |
-
"boxer briefs", "briefs", "trunks", "boxers", "jockstrap", "thong", "g-string",
|
| 189 |
-
"athletic briefs", "sport trunks", "compression shorts",
|
| 190 |
-
"open-back jockstrap", "wet look briefs",
|
| 191 |
-
],
|
| 192 |
-
"sex": [
|
| 193 |
-
"anvil position", "mating press", "piledriver position", "prison guard position", "chair position", "perching position", "cowgirl position", "doggystyle", "guard position", "leg glider position", "mastery position",
|
| 194 |
-
"mermaid position, tabletop", "Spoon Position", "Speed Bump Position", "reverse missionary position", "Reverse Stand and Carry Position", "butler position", "jockey position", "bent spoon position", "bodyguard position", "missionary position", "stand and carry position",
|
| 195 |
-
"reverse cowgirl position", "full nelson position", "deck chair position", "amazon position", "ballerina position", "dancer position", "bumper cars position", "arch position",
|
| 196 |
-
],
|
| 197 |
-
"topwear": [
|
| 198 |
-
"t-shirt", "tank top", "polo shirt",
|
| 199 |
-
"shirt", "button-up shirt", "flannel shirt", "unbuttoned shirt",
|
| 200 |
-
"long sleeve shirt",
|
| 201 |
-
"sweatshirt", "hoodie", "sweater",
|
| 202 |
-
"jacket", "coat", "vest", "jersey",
|
| 203 |
-
],
|
| 204 |
-
"duo": [
|
| 205 |
-
"duo", "two characters", "2 characters", "two figures", "2 figures", "pair",
|
| 206 |
-
],
|
| 207 |
-
"solo": [
|
| 208 |
-
"solo", "1 male", "single character", "one figure",
|
| 209 |
-
],
|
| 210 |
-
"bottomwear": [
|
| 211 |
-
"jeans", "cargo pants", "khaki pants", "chinos", "linen pants",
|
| 212 |
-
"sweatpants", "joggers", "shorts", "denim shorts", "cargo shorts",
|
| 213 |
-
"corduroy pants", "drawstring pants", "relaxed fit trousers", "capri pants", "rolled-up pants",
|
| 214 |
-
"leather pants",
|
| 215 |
-
"rubber pants",
|
| 216 |
-
],
|
| 217 |
-
"makingout": [
|
| 218 |
-
"making out", "kissing", "necking", "cuddling", "spooning", "hugging",
|
| 219 |
-
"back hug", "forehead kiss", "cheek kiss", "nose touch", "hand on waist",
|
| 220 |
-
"gentle embrace", "playful flirting", "body contact", "touching face",
|
| 221 |
-
"lip bite", "biting lips", "tongue kissing", "passionate kiss",
|
| 222 |
-
"holding hands", "caressing", "stroking hair", "nuzzling", "licking lips",
|
| 223 |
-
"seductive pose", "intimate embrace", "pressing bodies together", "sensual touch",
|
| 224 |
-
],
|
| 225 |
-
"light": [
|
| 226 |
-
"day", "bright", "sunlight", "sunrise", "sunset", "golden hour", "morning light", "afternoon light", "noon light",
|
| 227 |
-
"backlight", "rim light", "lens flare", "volumetric light", "god rays", "ray casting light", "neon glow",
|
| 228 |
-
"night", "dark", "dim light", "moonlight", "shadow", "silhouette", "starlight", "twilight",
|
| 229 |
-
"studio light", "window light", "candle light", "fireplace light", "ambient light", "soft light", "hard light",
|
| 230 |
-
"fog", "mist", "haze", "overcast", "diffused light", "dappled light", "reflected light", "spotlight", "floodlight", "colored light",
|
| 231 |
-
],
|
| 232 |
-
"perspective": [
|
| 233 |
-
"bird's-eye view", "worm's-eye view", "high-angle view", "low-angle view", "front view", "side view", "back view", "three-quarter view",
|
| 234 |
-
"dutch angle", "fisheye lens", "wide-angle lens", "telephoto lens", "macro lens", "close-up", "extreme close-up",
|
| 235 |
-
"over-the-shoulder view", "panoramic view", "foreshortening", "tilted perspective", "distorted perspective", "atmospheric perspective",
|
| 236 |
-
"isometric view", "top-down view", "bottom-up view", "diagonal view", "tilted camera angle", "dynamic angle", "eye-level view",
|
| 237 |
-
"low-key perspective", "high-key perspective", "tilt-shift perspective", "point-of-view", "bird’s eye panorama", "360-degree view",
|
| 238 |
-
"overhead shot", "tracking shot", "zoomed-in view", "zoomed-out view",
|
| 239 |
-
],
|
| 240 |
-
"face": [
|
| 241 |
-
"tongue out", "seductive", "bedroom eyes", "looking at viewer",
|
| 242 |
-
"looking embarrassed", "blushing", "nervous", "shy", "open mouth",
|
| 243 |
-
"grin", "playful", "quirky", "mischievous", "laughing", "happy", "joyful",
|
| 244 |
-
"caring", "kind face", "gentle smile", "smirk", "smile",
|
| 245 |
-
"surprised", "shocked", "astonished", "confused", "thinking",
|
| 246 |
-
"pensive", "curious", "serious", "determined", "focused",
|
| 247 |
-
"disappointed", "neutral", "calm", "relaxed", "content", "tired",
|
| 248 |
-
],
|
| 249 |
-
"colour": [
|
| 250 |
-
"yellow", "orange", "red", "pink", "purple", "blue", "light blue",
|
| 251 |
-
"green", "lime", "turquoise", "teal", "mint",
|
| 252 |
-
"brown", "beige", "tan", "olive", "khaki",
|
| 253 |
-
"white", "grey", "black",
|
| 254 |
-
"navy", "violet", "camo", "burgundy",
|
| 255 |
-
"ivory",
|
| 256 |
-
"gold", "silver",
|
| 257 |
-
],
|
| 258 |
-
}
|
| 259 |
-
|
| 260 |
-
def apply_scratchpad(prompt: str) -> str:
|
| 261 |
-
"""Korvaa [tagi] scratchpadin vaihtoehdoilla satunnaisesti.
|
| 262 |
-
Jos tagia ei löydy, poistetaan hakasulkeet kokonaan.
|
| 263 |
-
"""
|
| 264 |
-
matches = re.findall(r"\[(.+?)\]", prompt)
|
| 265 |
-
for tag in matches:
|
| 266 |
-
if tag in scratchpad:
|
| 267 |
-
choice = random.choice(scratchpad[tag])
|
| 268 |
-
# korvataan ilman hakasulkeita
|
| 269 |
-
prompt = prompt.replace(f"[{tag}]", choice, 1)
|
| 270 |
-
else:
|
| 271 |
-
# poistetaan tuntemattomat tagit
|
| 272 |
-
prompt = prompt.replace(f"[{tag}]", "", 1)
|
| 273 |
-
return prompt.strip()
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
resolutions = [
|
| 277 |
-
(592, 1768), (608, 1696), (640, 1624), (672, 1544),
|
| 278 |
-
(720, 1440), (744, 1392), (784, 1320), (832, 1248),
|
| 279 |
-
(864, 1208), (880, 1184), (912, 1144), (976, 1072),
|
| 280 |
-
(1024, 1024), (1072, 912), (1144, 912), (1184, 880),
|
| 281 |
-
(1208, 864), (1248, 832), (1320, 784), (1392, 744),
|
| 282 |
-
(1440, 720), (1544, 672), (1624, 640), (1696, 608),
|
| 283 |
-
(1768, 592),
|
| 284 |
-
]
|
| 285 |
-
|
| 286 |
-
@spaces.GPU
|
| 287 |
-
def generate(prompt, negative_prompt, width, height, random_res, selected_style):
|
| 288 |
-
if random_res:
|
| 289 |
-
width, height = random.choice(resolutions)
|
| 290 |
-
|
| 291 |
-
prompt = apply_scratchpad(prompt)
|
| 292 |
-
|
| 293 |
-
# Rakennetaan listat aktiivisista adaptereista ja niiden painoista
|
| 294 |
-
adapter_names = []
|
| 295 |
-
adapter_weights = []
|
| 296 |
-
|
| 297 |
-
# 1) Pysyvät LoRAt
|
| 298 |
-
for name, (_, w) in PERSISTENT_LORAS.items():
|
| 299 |
-
adapter_names.append(name)
|
| 300 |
-
adapter_weights.append(w)
|
| 301 |
-
|
| 302 |
-
# 2) Tyyli-LoRA + trigger
|
| 303 |
-
if selected_style in STYLE_LORAS and selected_style != "None":
|
| 304 |
-
repo, style_w, trigger, style_adapter = STYLE_LORAS[selected_style]
|
| 305 |
-
prompt = f"{trigger}, {prompt}"
|
| 306 |
-
adapter_names.append(style_adapter)
|
| 307 |
-
adapter_weights.append(style_w) # esim. 7.0 jos haluat “mössöä”
|
| 308 |
-
# jos "None", ei lisätä tyyliadapteria
|
| 309 |
-
|
| 310 |
-
# Varmuuden vuoksi: ei fuseta, vaan käytetään dynaamisia painoja
|
| 311 |
-
# Jos olet joskus fusennut, nollaa se ensin:
|
| 312 |
-
try:
|
| 313 |
-
pipe.unfuse_lora()
|
| 314 |
-
except Exception:
|
| 315 |
-
pass
|
| 316 |
-
|
| 317 |
-
pipe.set_adapters(adapter_names, adapter_weights=adapter_weights)
|
| 318 |
-
|
| 319 |
-
quality_suffix = (
|
| 320 |
-
", (anthro), (male), (best quality), high resolution, (ultra detailed),"
|
| 321 |
-
" 8k, (highly detailed), (masterpiece), (sharp focus), (intricate details),"
|
| 322 |
-
" (perfect anatomy), (depth of field), high dynamic range, (smooth shading),"
|
| 323 |
-
" (realistic shadows), (rich texture), professional color grading, (fine details),"
|
| 324 |
-
" ultra sharp, HDR, (anatomically correct), meesh, by meesh, aaron, 20r0j_2, civifur"
|
| 325 |
-
)
|
| 326 |
-
|
| 327 |
-
full_prompt = prompt + quality_suffix
|
| 328 |
-
|
| 329 |
-
image = pipe(
|
| 330 |
-
prompt=full_prompt,
|
| 331 |
-
negative_prompt=negative_prompt,
|
| 332 |
-
width=width,
|
| 333 |
-
height=height,
|
| 334 |
-
num_inference_steps=35,
|
| 335 |
-
guidance_scale=7.5
|
| 336 |
-
).images[0]
|
| 337 |
-
|
| 338 |
-
# (Valinnainen) palautetaan tekstiin näkyviin mitkä adapterit ja painot oli käytössä
|
| 339 |
-
used = ", ".join([f"{n}:{w}" for n, w in zip(adapter_names, adapter_weights)])
|
| 340 |
-
return image, f"{full_prompt}\n\n[adapters] {used}"
|
| 341 |
-
|
| 342 |
-
# UI sama kuin ennen
|
| 343 |
-
gr.Interface(
|
| 344 |
-
fn=generate,
|
| 345 |
-
inputs=[
|
| 346 |
-
gr.Textbox(label="Prompt"),
|
| 347 |
-
gr.Textbox(
|
| 348 |
-
label="Negative Prompt",
|
| 349 |
-
value="(worst quality), (low quality), (blurry), (bad anatomy), (fused fingers), (extra fingers), (missing fingers), (deformed), (jpeg artifacts), (watermark), (signature), text, error, out of frame, bad hands, bad feet, bad proportions, fused limbs, cropped, username, logo, bad perspective, lowres, overexposure, bad artist, bad composition, distorted, oversaturated, mutated, bad shadow, multiple limbs, extra arms, extra legs, bad background, tilted, bad lighting, bad face, ugly, bad eyes, disfigured, multiple pictures"
|
| 350 |
-
),
|
| 351 |
-
gr.Slider(minimum=512, maximum=1024, step=64, value=768, label="Width"),
|
| 352 |
-
gr.Slider(minimum=512, maximum=1024, step=64, value=768, label="Height"),
|
| 353 |
-
gr.Checkbox(label="Random resolution mode (override sliders)", value=True),
|
| 354 |
-
gr.Dropdown(
|
| 355 |
-
choices=list(STYLE_LORAS.keys()),
|
| 356 |
-
value="None",
|
| 357 |
-
label="Select Style"
|
| 358 |
-
)
|
| 359 |
-
],
|
| 360 |
-
outputs=[
|
| 361 |
-
gr.Image(label="Generated Image"),
|
| 362 |
-
gr.Textbox(label="Used Prompt", lines=6)
|
| 363 |
-
],
|
| 364 |
-
title="FURRYSTYLE",
|
| 365 |
-
description="Give a prompt"
|
| 366 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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