Yaron Koresh commited on
Commit
b806069
·
verified ·
1 Parent(s): f86add6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -83,27 +83,27 @@ def generate_random_string(length):
83
  characters = string.ascii_letters + string.digits
84
  return ''.join(random.choice(characters) for _ in range(length))
85
 
86
- @spaces.GPU(duration=50)
87
  def Piper(_do,_dont):
88
  return pipe(
89
  _do,
90
  height=320,
91
  width=640,
92
  negative_prompt=_dont,
93
- num_inference_steps=200,
94
- guidance_scale=10
95
  )
96
 
97
  def infer(prompt_en,prompt2_en):
98
  name = generate_random_string(12)+".png"
99
  if prompt_en == "":
100
- _do = 'natural coloring, epic scene, reasonable proportions, realistic content, highly detailed photograph'
101
  else:
102
- _do = f'photographed { prompt_en }, natural coloring, epic scene, reasonable proportions, realistic content, highly detailed photograph'
103
  if prompt2_en == "":
104
- _dont = 'smooth texture, fictional proportions, blurred content, distorted items, deformed palms, logos and signs, texts and prints'
105
  else:
106
- _dont = f'{prompt2_en} where in {prompt_en}, smooth texture, fictional proportions, blurred content, distorted items, deformed palms, logos and signs, texts and prints'
107
  image = Piper(_do,_dont).images[0].save(name)
108
  return name
109
 
 
83
  characters = string.ascii_letters + string.digits
84
  return ''.join(random.choice(characters) for _ in range(length))
85
 
86
+ @spaces.GPU(duration=40)
87
  def Piper(_do,_dont):
88
  return pipe(
89
  _do,
90
  height=320,
91
  width=640,
92
  negative_prompt=_dont,
93
+ num_inference_steps=100,
94
+ guidance_scale=4
95
  )
96
 
97
  def infer(prompt_en,prompt2_en):
98
  name = generate_random_string(12)+".png"
99
  if prompt_en == "":
100
+ _do = 'photographed reasonable situation'
101
  else:
102
+ _do = f'photographed { prompt_en } reasonable situation'
103
  if prompt2_en == "":
104
+ _dont = 'unformed, unproportional, boring, smooth, fictional, blurred, twisted, distorted, divined, body defects, damaged structure, signs, prints'
105
  else:
106
+ _dont = f'{prompt2_en} where in {prompt_en}, unformed, unproportional, boring, smooth, fictional, blurred, twisted, distorted, divined, body defects, damaged structure, signs, prints'
107
  image = Piper(_do,_dont).images[0].save(name)
108
  return name
109