alfredplpl commited on
Commit
7507930
1 Parent(s): e87a756

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -52,28 +52,29 @@ def auto_prompt_correction(prompt_ui,neg_prompt_ui):
52
  neg_prompt=neg_prompt.lower()
53
  if(prompt=="" and neg_prompt==""):
54
  prompt="anime, a portrait of a girl, 4k, detailed"
55
- neg_prompt=" (((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, 2d, 3d, cg, text"
56
 
57
  splited_prompt=prompt.replace(","," ").replace("_"," ").split(" ")
58
- splited_prompt=["girl" if p=="1girl" or p=="solo" else p for p in splited_prompt]
 
59
  splited_prompt=["boy" if p=="1boy" else p for p in splited_prompt]
60
  human_words=["girl","maid","female","woman","boy","male","man","guy"]
61
  for word in human_words:
62
  if( word in splited_prompt):
63
  prompt=f"anime, {prompt}, 4k, detailed"
64
- neg_prompt=" (((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, 2d, 3d, cg, text"
65
 
66
  animal_words=["cat","dog","bird"]
67
  for word in animal_words:
68
  if( word in splited_prompt):
69
  prompt=f"anime, a {word}, 4k, detailed"
70
- neg_prompt=" (((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, 2d, 3d, cg, text"
71
 
72
  background_words=["mount fuji","mt. fuji","building", "buildings", "tokyo", "kyoto", "shibuya", "shinjuku"]
73
  for word in background_words:
74
  if( word in splited_prompt):
75
  prompt=f"anime, shinkai makoto, {word}, 4k, 8k, highly detailed"
76
- neg_prompt=" (((deformed))), photo, people, low quality, ui, error, lowres, jpeg artifacts, 2d, 3d, cg, text"
77
 
78
  return prompt,neg_prompt
79
 
 
52
  neg_prompt=neg_prompt.lower()
53
  if(prompt=="" and neg_prompt==""):
54
  prompt="anime, a portrait of a girl, 4k, detailed"
55
+ neg_prompt=f"(((deformed))), blurry, ((((bad anatomy)))), {neg_prompt}, 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, 2d, 3d, cg, text"
56
 
57
  splited_prompt=prompt.replace(","," ").replace("_"," ").split(" ")
58
+ splited_prompt=["a person" if p=="solo" else p for p in splited_prompt]
59
+ splited_prompt=["girl" if p=="1girl" else p for p in splited_prompt]
60
  splited_prompt=["boy" if p=="1boy" else p for p in splited_prompt]
61
  human_words=["girl","maid","female","woman","boy","male","man","guy"]
62
  for word in human_words:
63
  if( word in splited_prompt):
64
  prompt=f"anime, {prompt}, 4k, detailed"
65
+ neg_prompt=f"(((deformed))), blurry, ((((bad anatomy)))), {neg_prompt}, 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, 2d, 3d, cg, text"
66
 
67
  animal_words=["cat","dog","bird"]
68
  for word in animal_words:
69
  if( word in splited_prompt):
70
  prompt=f"anime, a {word}, 4k, detailed"
71
+ neg_prompt=f"(((deformed))), blurry, ((((bad anatomy)))), {neg_prompt}, 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, 2d, 3d, cg, text"
72
 
73
  background_words=["mount fuji","mt. fuji","building", "buildings", "tokyo", "kyoto", "shibuya", "shinjuku"]
74
  for word in background_words:
75
  if( word in splited_prompt):
76
  prompt=f"anime, shinkai makoto, {word}, 4k, 8k, highly detailed"
77
+ neg_prompt=f"(((deformed))), {neg_prompt}, photo, people, low quality, ui, error, lowres, jpeg artifacts, 2d, 3d, cg, text"
78
 
79
  return prompt,neg_prompt
80