Yaron Koresh commited on
Commit
a5c674b
·
verified ·
1 Parent(s): fef1dcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -104,7 +104,7 @@ function custom(){
104
  e.target.setAttribute("last_value",e.target.value);
105
  });
106
  document.querySelector("div#prompt input").addEventListener("input",function(e){
107
- if( e.target.value.toString().match(/[^ a-zA-Z,]/gsm) ){
108
  e.target.value = e.target.getAttribute("last_value");
109
  e.target.removeAttribute("last_value");
110
  }
@@ -114,7 +114,7 @@ function custom(){
114
  e.target.setAttribute("last_value",e.target.value);
115
  });
116
  document.querySelector("div#prompt2 input").addEventListener("input",function(e){
117
- if( e.target.value.toString().match(/[^ a-zA-Z,]/gsm) ){
118
  e.target.value = e.target.getAttribute("last_value");
119
  e.target.removeAttribute("last_value");
120
  }
@@ -238,15 +238,15 @@ def handle_generate(*_inp):
238
  #inp[1] = translate(inp[1],"english")
239
  #inp[2] = translate(inp[2],"english")
240
 
241
- if inp[2] != "":
242
- inp[2] = ", " + inp[2]
243
 
244
- inp[2] = f"textual content, pixelated photo, unrealistic situation, cgi, anime or cartoon quality, drawing quality, cropped photo, photo out of frame, worst quality, low quality, rendering artifacts, duplicated elements, weird style, non-standard humans body, non-standard objects structure, blurry photo, wrong body anatomy, unproportional, cloned face{inp[2]}"
245
 
246
- if inp[1] != "":
247
- inp[1] = ", " + inp[1]
248
 
249
- inp[1] = f'realistic situations, dark vivid colors, realistic, beautiful pretty look, genuine and authentic reality, logical reasonable photo content, natural look, masterpiece photo, highly detailed photo{inp[1]}'
250
 
251
  print(f"""
252
 
 
104
  e.target.setAttribute("last_value",e.target.value);
105
  });
106
  document.querySelector("div#prompt input").addEventListener("input",function(e){
107
+ if( e.target.value.toString().match(/[^ a-zA-Z,]|( |,){2,}/gsm) ){
108
  e.target.value = e.target.getAttribute("last_value");
109
  e.target.removeAttribute("last_value");
110
  }
 
114
  e.target.setAttribute("last_value",e.target.value);
115
  });
116
  document.querySelector("div#prompt2 input").addEventListener("input",function(e){
117
+ if( e.target.value.toString().match(/[^ a-zA-Z,]|( |,){2,}/gsm) ){
118
  e.target.value = e.target.getAttribute("last_value");
119
  e.target.removeAttribute("last_value");
120
  }
 
238
  #inp[1] = translate(inp[1],"english")
239
  #inp[2] = translate(inp[2],"english")
240
 
241
+ if inp[2].length >= 2:
242
+ inp[2] = "," + inp[2].strip(",").strip(" ")
243
 
244
+ inp[2] = f"textual content,pixelated photo,unrealistic situation,cgi,anime or cartoon quality,drawing quality,cropped photo,photo out of frame,worst quality,low quality,rendering artifacts,duplicated elements,weird style,non-standard humans body,non-standard objects structure,blurry photo,wrong body anatomy,unproportional,cloned face{inp[2]}"
245
 
246
+ if inp[1].length >= 2:
247
+ inp[1] = "," + inp[1].strip(",").strip(" ")
248
 
249
+ inp[1] = f'realistic situations,dark vivid colors,realistic,beautiful pretty look,genuine and authentic reality,logical reasonable photo content,natural look,masterpiece photo,highly detailed photo{inp[1]}'
250
 
251
  print(f"""
252