Yaron Koresh commited on
Commit
dc7ca38
·
verified ·
1 Parent(s): 5686b14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -71,15 +71,15 @@ def generate_random_string(length):
71
  characters = string.ascii_letters + string.digits
72
  return ''.join(random.choice(characters) for _ in range(length))
73
 
74
- @spaces.GPU(duration=17)
75
  def Piper(_do,_dont):
76
  return pipe(
77
  _do,
78
  height=384,
79
  width=512,
80
  negative_prompt=_dont,
81
- num_inference_steps=45,
82
- guidance_scale=9
83
  )
84
 
85
  def infer(prompt,prompt2):
@@ -87,9 +87,9 @@ def infer(prompt,prompt2):
87
  prompt_en = translate(prompt,"english")
88
  prompt2_en = translate(prompt2,"english")
89
  if prompt == None or prompt.strip() == "":
90
- _do = 'vivid colors, rough texture, dynamic poze, realistic details, award winning photograph, soft natural lighting, deep field, high definition, highly detailed, calm background'
91
  else:
92
- _do = f'{ prompt_en }, vivid colors, rough texture, dynamic poze, realistic details, award winning photograph, soft natural lighting, deep field, high definition, highly detailed, calm background'
93
  if prompt2 == None or prompt2.strip() == "":
94
  _dont = 'ugly, deformed, inflated, disfigured, poor details, bad anatomy, logos, texts, labels'
95
  else:
 
71
  characters = string.ascii_letters + string.digits
72
  return ''.join(random.choice(characters) for _ in range(length))
73
 
74
+ @spaces.GPU(duration=27)
75
  def Piper(_do,_dont):
76
  return pipe(
77
  _do,
78
  height=384,
79
  width=512,
80
  negative_prompt=_dont,
81
+ num_inference_steps=65,
82
+ guidance_scale=5
83
  )
84
 
85
  def infer(prompt,prompt2):
 
87
  prompt_en = translate(prompt,"english")
88
  prompt2_en = translate(prompt2,"english")
89
  if prompt == None or prompt.strip() == "":
90
+ _do = 'natural colors, rough texture, dynamic poze, proportional arrangement, realistic, soft natural lighting, deep field, highly detailed, blurred background'
91
  else:
92
+ _do = f'{ prompt_en }, natural colors, rough texture, dynamic poze, proportional arrangement, realistic, soft natural lighting, deep field, highly detailed, blurred background'
93
  if prompt2 == None or prompt2.strip() == "":
94
  _dont = 'ugly, deformed, inflated, disfigured, poor details, bad anatomy, logos, texts, labels'
95
  else: