Shaamallow commited on
Commit
2e581a8
1 Parent(s): 183c72e

update demo with examples

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -96,7 +96,6 @@ def invert_image(model, image: np.ndarray, n_steps: int, width: int, height: int
96
  image_tensor = image_tensor.unsqueeze(0)
97
  latent = img_to_latents(image_tensor, model.vae)
98
 
99
- print(latent)
100
  model.set_ip_adapter_scale(0)
101
 
102
  inv_latents = model(
@@ -175,11 +174,19 @@ def generate(
175
  return image
176
 
177
 
178
- examples = [
179
- "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
180
- "An astronaut riding a green horse",
 
 
 
 
181
  ]
182
 
 
 
 
 
183
  with gr.Blocks(css=css) as demo:
184
  gr.Markdown(DESCRIPTION)
185
 
@@ -299,7 +306,7 @@ with gr.Blocks(css=css) as demo:
299
 
300
  gr.Examples(
301
  examples=examples,
302
- inputs=prompt,
303
  outputs=result,
304
  fn=generate,
305
  )
 
96
  image_tensor = image_tensor.unsqueeze(0)
97
  latent = img_to_latents(image_tensor, model.vae)
98
 
 
99
  model.set_ip_adapter_scale(0)
100
 
101
  inv_latents = model(
 
174
  return image
175
 
176
 
177
+ examples_prompts = [
178
+ "Astronaut in a jungle, detailed, 8k",
179
+ "A Bird",
180
+ "A Tiger",
181
+ "A Cat",
182
+ "cactus",
183
+ "A Panda",
184
  ]
185
 
186
+ examples_images = [f"./images/{i}.png" for i in range(6)]
187
+
188
+ examples = [[prompt, image] for prompt, image in zip(examples_prompts, examples_images)]
189
+
190
  with gr.Blocks(css=css) as demo:
191
  gr.Markdown(DESCRIPTION)
192
 
 
306
 
307
  gr.Examples(
308
  examples=examples,
309
+ inputs=[prompt, style_image],
310
  outputs=result,
311
  fn=generate,
312
  )