Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ with gr.Blocks() as demo:
|
|
45 |
with gr.Row():
|
46 |
with gr.Column():
|
47 |
# scribble = gr.Image(source="canvas", tool="color-sketch", shape=(512, 512), height=768, width=768, type="pil")
|
48 |
-
scribble = gr.ImageEditor(type="pil", image_mode="L", crop_size=(512, 512), sources=(), brush=gr.Brush(color_mode="fixed", colors=["#
|
49 |
# scribble_out = gr.Image(height=384, width=384)
|
50 |
num_images = gr.Slider(label="Number of Images", minimum=1, maximum=8, step=1, value=4, interactive=True)
|
51 |
steps = gr.Slider(label="Inference Steps", minimum=1, maximum=8, step=1, value=1, interactive=True)
|
@@ -66,7 +66,8 @@ with gr.Blocks() as demo:
|
|
66 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.float16), timer("inference"):
|
67 |
result = pipe(
|
68 |
prompt=[prompt]*num_images,
|
69 |
-
image=[ImageOps.invert(scribble['composite'])]*num_images,
|
|
|
70 |
generator=torch.Generator().manual_seed(int(seed)),
|
71 |
num_inference_steps=steps,
|
72 |
guidance_scale=0.,
|
|
|
45 |
with gr.Row():
|
46 |
with gr.Column():
|
47 |
# scribble = gr.Image(source="canvas", tool="color-sketch", shape=(512, 512), height=768, width=768, type="pil")
|
48 |
+
scribble = gr.ImageEditor(type="pil", image_mode="L", crop_size=(512, 512), sources=(), brush=gr.Brush(color_mode="fixed", colors=["#000000"]))
|
49 |
# scribble_out = gr.Image(height=384, width=384)
|
50 |
num_images = gr.Slider(label="Number of Images", minimum=1, maximum=8, step=1, value=4, interactive=True)
|
51 |
steps = gr.Slider(label="Inference Steps", minimum=1, maximum=8, step=1, value=1, interactive=True)
|
|
|
66 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.float16), timer("inference"):
|
67 |
result = pipe(
|
68 |
prompt=[prompt]*num_images,
|
69 |
+
# image=[ImageOps.invert(scribble['composite'])]*num_images,
|
70 |
+
image=[scribble['composite']]*num_images,
|
71 |
generator=torch.Generator().manual_seed(int(seed)),
|
72 |
num_inference_steps=steps,
|
73 |
guidance_scale=0.,
|