dreamdrop-art commited on
Commit
f71d017
1 Parent(s): 2e7bb9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -119,6 +119,9 @@ def get_data(text):
119
  results['h'] = None
120
  return results
121
 
 
 
 
122
 
123
  def send_to_txt2img(image):
124
 
@@ -171,7 +174,7 @@ def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, he
171
 
172
  job = prodia_client.wait(result)
173
 
174
- return job["imageUrl"]
175
 
176
 
177
  def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
@@ -191,7 +194,7 @@ def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampl
191
 
192
  job = prodia_client.wait(result)
193
 
194
- return job["imageUrl"]
195
 
196
 
197
  css = """
@@ -240,7 +243,10 @@ with gr.Blocks(css=css) as demo:
240
  seed = gr.Number(label="Seed", value=-1)
241
 
242
  with gr.Column(scale=2):
243
- image_output = gr.Image(value="https://images.prodia.xyz/8ede1a7c-c0ee-4ded-987d-6ffed35fc477.png")
 
 
 
244
 
245
  text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height,
246
  seed], outputs=image_output, concurrency_limit=64)
@@ -279,7 +285,7 @@ with gr.Blocks(css=css) as demo:
279
  i2i_seed = gr.Number(label="Seed", value=-1)
280
 
281
  with gr.Column(scale=2):
282
- i2i_image_output = gr.Image(value="https://images.prodia.xyz/8ede1a7c-c0ee-4ded-987d-6ffed35fc477.png")
283
 
284
  i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt,
285
  model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height,
 
119
  results['h'] = None
120
  return results
121
 
122
+ def send_to_img2img(image):
123
+ result = Image.open(image)
124
+ return [result]
125
 
126
  def send_to_txt2img(image):
127
 
 
174
 
175
  job = prodia_client.wait(result)
176
 
177
+ return [job["imageUrl"]]
178
 
179
 
180
  def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed):
 
194
 
195
  job = prodia_client.wait(result)
196
 
197
+ return [job["imageUrl"]]
198
 
199
 
200
  css = """
 
243
  seed = gr.Number(label="Seed", value=-1)
244
 
245
  with gr.Column(scale=2):
246
+ image_output = gr.Gallery(show_label=False, columns=4)
247
+ send_to_img2img = gr.Button(variant="secondary", value="Send to img2img")
248
+
249
+ send_to_img2img.click(send_to_img2img, inputs=image_output, outputs=i2i_image_input)
250
 
251
  text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height,
252
  seed], outputs=image_output, concurrency_limit=64)
 
285
  i2i_seed = gr.Number(label="Seed", value=-1)
286
 
287
  with gr.Column(scale=2):
288
+ i2i_image_output = gr.Gallery(show_label=False, columns=4)
289
 
290
  i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt,
291
  model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height,