Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,7 +63,7 @@ def infer(edit_images, prompt, seed=42, randomize_seed=False, width=1024, height
|
|
| 63 |
mask = edit_images["layers"][0].convert("RGB")
|
| 64 |
if randomize_seed:
|
| 65 |
seed = random.randint(0, MAX_SEED)
|
| 66 |
-
|
| 67 |
prompt=prompt,
|
| 68 |
inpaint_image=image,
|
| 69 |
inpaint_mask=mask,
|
|
@@ -75,7 +75,7 @@ def infer(edit_images, prompt, seed=42, randomize_seed=False, width=1024, height
|
|
| 75 |
num_inference_steps=num_inference_steps,
|
| 76 |
generator=torch.Generator("cpu").manual_seed(seed)
|
| 77 |
).images[0]
|
| 78 |
-
return image, seed
|
| 79 |
|
| 80 |
examples = [
|
| 81 |
"a tiny astronaut hatching from an egg on the moon",
|
|
@@ -115,7 +115,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 115 |
)
|
| 116 |
run_button = gr.Button("Run")
|
| 117 |
|
| 118 |
-
result = gr.
|
| 119 |
|
| 120 |
with gr.Accordion("Advanced Settings", open=False):
|
| 121 |
|
|
|
|
| 63 |
mask = edit_images["layers"][0].convert("RGB")
|
| 64 |
if randomize_seed:
|
| 65 |
seed = random.randint(0, MAX_SEED)
|
| 66 |
+
out_image = pipe(
|
| 67 |
prompt=prompt,
|
| 68 |
inpaint_image=image,
|
| 69 |
inpaint_mask=mask,
|
|
|
|
| 75 |
num_inference_steps=num_inference_steps,
|
| 76 |
generator=torch.Generator("cpu").manual_seed(seed)
|
| 77 |
).images[0]
|
| 78 |
+
return (image, out_image), seed
|
| 79 |
|
| 80 |
examples = [
|
| 81 |
"a tiny astronaut hatching from an egg on the moon",
|
|
|
|
| 115 |
)
|
| 116 |
run_button = gr.Button("Run")
|
| 117 |
|
| 118 |
+
result = gr.ImageSlider(label="Generated Image", type="pil", image_mode='RGB')
|
| 119 |
|
| 120 |
with gr.Accordion("Advanced Settings", open=False):
|
| 121 |
|