Yaron Koresh commited on
Commit
6155911
·
verified ·
1 Parent(s): a45bb10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -87,11 +87,11 @@ def generate_random_string(length):
87
  def Piper(_do,_dont):
88
  return pipe(
89
  _do,
90
- height=448,
91
- width=480,
92
  negative_prompt=_dont,
93
- num_inference_steps=50,
94
- guidance_scale=6
95
  )
96
 
97
  def infer(prompt_en,prompt2_en):
@@ -101,9 +101,9 @@ def infer(prompt_en,prompt2_en):
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, human body defects, deformed fingers, ugly fingers, wrong fingers, damaged, signs, prints'
105
  else:
106
- _dont = f'{prompt2_en} anywhere in, unformed, unproportional, boring, smooth, fictional, blurred, twisted, distorted, divined, human body defects, deformed fingers, ugly fingers, wrong fingers, damaged, text anywhere in, prints anywhere in'
107
  image = Piper(_do,_dont).images[0].save(name)
108
  return name
109
 
@@ -128,7 +128,7 @@ footer {
128
  max-width: 15cm !important;
129
  }
130
  .image-container {
131
- aspect-ratio: 480 / 448 !important;
132
  }
133
  .dropdown-arrow {
134
  display: none !important;
@@ -178,15 +178,9 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
178
  with gr.Row():
179
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
180
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
181
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
182
- with gr.Row():
183
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
184
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
185
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
186
  with gr.Row():
187
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
188
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
189
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
190
 
191
  def _ret(idx,p1,p2):
192
  print(f'Starting {idx}: {p1} {p2}')
 
87
  def Piper(_do,_dont):
88
  return pipe(
89
  _do,
90
+ height=256,
91
+ width=384,
92
  negative_prompt=_dont,
93
+ num_inference_steps=100,
94
+ guidance_scale=3
95
  )
96
 
97
  def infer(prompt_en,prompt2_en):
 
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, human defects, fingers defects, palms defects, unreal eyes, signs, prints'
105
  else:
106
+ _dont = f'{prompt2_en} where anywhere, unformed, unproportional, boring, smooth, fictional, blurred, twisted, distorted, divined, human defects, fingers defects, palms defects, unreal eyes, text anywhere in, prints where anywhere'
107
  image = Piper(_do,_dont).images[0].save(name)
108
  return name
109
 
 
128
  max-width: 15cm !important;
129
  }
130
  .image-container {
131
+ aspect-ratio: 384 / 256 !important;
132
  }
133
  .dropdown-arrow {
134
  display: none !important;
 
178
  with gr.Row():
179
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
180
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
 
 
 
 
 
181
  with gr.Row():
182
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
183
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
 
184
 
185
  def _ret(idx,p1,p2):
186
  print(f'Starting {idx}: {p1} {p2}')