yaron123 commited on
Commit
7e211bb
·
1 Parent(s): 43b7e5d
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -58,8 +58,8 @@ additional_image = None
58
 
59
  seq=512
60
  fps=18
61
- width=1440
62
- height=1440
63
  image_steps=8
64
  video_steps=15
65
  accu=6.5
@@ -187,7 +187,7 @@ def generate_random_string(length):
187
  characters = str(ascii_letters + digits)
188
  return ''.join(random.choice(characters) for _ in range(length))
189
 
190
- @spaces.GPU(duration=40)
191
  def pipe_generate(img,p1,p2,time,title):
192
  global pipe
193
 
@@ -207,11 +207,12 @@ def pipe_generate(img,p1,p2,time,title):
207
 
208
  if title != "":
209
  draw = ImageDraw.Draw(img)
210
- textheight=60
 
211
  font = ImageFont.truetype(r"OpenSans-Bold.ttf", textheight)
212
  textwidth = draw.textlength(title,font)
213
  x = (width - textwidth) // 2
214
- y = (height - textheight) // 2
215
  draw.text((x, y), title, (255,255,255), font=font)
216
 
217
  additional_image = img if additional_image else None
@@ -242,12 +243,12 @@ def handle_generate(*_inp):
242
  if len(inp[2]) >= 2:
243
  inp[2] = "," + inp[2].strip(",").strip(" ")
244
 
245
- 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]}"
246
 
247
  if len(inp[1]) >= 2:
248
  inp[1] = "," + inp[1].strip(",").strip(" ")
249
 
250
- 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]}'
251
 
252
  print(f"""
253
 
 
58
 
59
  seq=512
60
  fps=18
61
+ width=768
62
+ height=768
63
  image_steps=8
64
  video_steps=15
65
  accu=6.5
 
187
  characters = str(ascii_letters + digits)
188
  return ''.join(random.choice(characters) for _ in range(length))
189
 
190
+ @spaces.GPU(duration=80)
191
  def pipe_generate(img,p1,p2,time,title):
192
  global pipe
193
 
 
207
 
208
  if title != "":
209
  draw = ImageDraw.Draw(img)
210
+ textheight=100
211
+ rows = 1
212
  font = ImageFont.truetype(r"OpenSans-Bold.ttf", textheight)
213
  textwidth = draw.textlength(title,font)
214
  x = (width - textwidth) // 2
215
+ y = (height - (textheight * rows // 2)) // 2
216
  draw.text((x, y), title, (255,255,255), font=font)
217
 
218
  additional_image = img if additional_image else None
 
243
  if len(inp[2]) >= 2:
244
  inp[2] = "," + inp[2].strip(",").strip(" ")
245
 
246
+ inp[2] = f"textual content,unrealistic content,divined creatures,unrealistic creatures,creatures out of this world,demon,angel,cgi quality,anime quality,cartoon quality,drawing quality,cropped photo,cropped content,worst quality,low quality,duplicating elements,weird,non-standard human body,non-standard object structure,blur,wrong body anatomy,too big, too small,text,written content{inp[2]}"
247
 
248
  if len(inp[1]) >= 2:
249
  inp[1] = "," + inp[1].strip(",").strip(" ")
250
 
251
+ inp[1] = f'realistic,vivid,looks beautiful and pretty,look genuine and authentic,reasonable logic,natural,masterpiece,highly detailed{inp[1]}'
252
 
253
  print(f"""
254