renyuxi commited on
Commit
07c50cf
·
verified ·
1 Parent(s): 8db3b22

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -48,7 +48,7 @@ with gr.Blocks() as demo:
48
  controlnet_scale = gr.Number(label="ControlNet Conditioning Scale", value=1.0, interactive=True)
49
  prompt = gr.Text(label="Prompt", value="a photo of a cat", interactive=True)
50
  seed = gr.Number(label="Seed", value=3413, interactive=True)
51
- scribble = gr.Image(source="canvas", tool="color-sketch", shape=(512, 512), height=768, width=768, type="pil")
52
  btn = gr.Button(value="run")
53
  with gr.Column():
54
  output = gr.Gallery(height=768)
@@ -59,7 +59,7 @@ with gr.Blocks() as demo:
59
  with torch.inference_mode(), torch.autocast("cuda", dtype=torch.float16), timer("inference"):
60
  return pipe(
61
  prompt=[prompt]*num_images,
62
- image=[scribble]*num_images,
63
  generator=torch.Generator().manual_seed(int(seed)),
64
  num_inference_steps=steps,
65
  guidance_scale=0.,
 
48
  controlnet_scale = gr.Number(label="ControlNet Conditioning Scale", value=1.0, interactive=True)
49
  prompt = gr.Text(label="Prompt", value="a photo of a cat", interactive=True)
50
  seed = gr.Number(label="Seed", value=3413, interactive=True)
51
+ scribble = gr.ImageEditor(height=768, width=768, type="pil")
52
  btn = gr.Button(value="run")
53
  with gr.Column():
54
  output = gr.Gallery(height=768)
 
59
  with torch.inference_mode(), torch.autocast("cuda", dtype=torch.float16), timer("inference"):
60
  return pipe(
61
  prompt=[prompt]*num_images,
62
+ image=[scribble.resize((512, 512))]*num_images,
63
  generator=torch.Generator().manual_seed(int(seed)),
64
  num_inference_steps=steps,
65
  guidance_scale=0.,