alfredplpl
commited on
Commit
·
7f16cc8
1
Parent(s):
844032f
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ from transformers import CLIPFeatureExtractor
|
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
from PIL import Image
|
|
|
7 |
|
8 |
model_id = 'aipicasso/cool-japan-diffusion-2-1-1'
|
9 |
|
@@ -74,7 +75,11 @@ def auto_prompt_correction(prompt_ui,neg_prompt_ui,cool_japan_type_ui):
|
|
74 |
prompt=prompt.lower()
|
75 |
neg_prompt=neg_prompt.lower()
|
76 |
if(prompt=="" and neg_prompt==""):
|
77 |
-
|
|
|
|
|
|
|
|
|
78 |
neg_prompt=f"(((deformed))), blurry, ((((bad anatomy)))), bad pupil, disfigured, poorly drawn face, mutation, mutated, (extra limb), (ugly), (poorly drawn hands), bad hands, fused fingers, messy drawing, broken legs censor, low quality, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2), ((bad eyes)), ui, error, missing fingers, fused fingers, one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit, one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit, long body, uncoordinated body, unnatural body, lowres, jpeg artifacts, 3d, cg, text"
|
79 |
return prompt, neg_prompt
|
80 |
|
|
|
4 |
import gradio as gr
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
+
import random
|
8 |
|
9 |
model_id = 'aipicasso/cool-japan-diffusion-2-1-1'
|
10 |
|
|
|
75 |
prompt=prompt.lower()
|
76 |
neg_prompt=neg_prompt.lower()
|
77 |
if(prompt=="" and neg_prompt==""):
|
78 |
+
prefix=["masterpiece","evangelion, mika pikazo", "konosuba, mika pikazo","steins; gate, ilya kuvshinov"]
|
79 |
+
suffix=["","ayanami rei, asuka langrey", "megumin, aqua","mayuri shiina from steins gate, kurisu makise steins gate anime"]
|
80 |
+
prefix_index=random.randrange(len(prefix))
|
81 |
+
suffix_index=random.randrange(len(suffix))
|
82 |
+
prompt=f"{cool_japan_type}, {prefix[prefix_index]}, a portrait of a good girl, {suffix[suffix_index]}, good pupil, 4k, detailed"
|
83 |
neg_prompt=f"(((deformed))), blurry, ((((bad anatomy)))), bad pupil, disfigured, poorly drawn face, mutation, mutated, (extra limb), (ugly), (poorly drawn hands), bad hands, fused fingers, messy drawing, broken legs censor, low quality, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2), ((bad eyes)), ui, error, missing fingers, fused fingers, one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit, one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit, long body, uncoordinated body, unnatural body, lowres, jpeg artifacts, 3d, cg, text"
|
84 |
return prompt, neg_prompt
|
85 |
|