ayyuce commited on
Commit
1c649b3
·
verified ·
1 Parent(s): 83851d4

Removed source parameter

Browse files

Removed source parameter since it is not accepted in the current Gradio version.

Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -11,7 +11,7 @@ controlnet = ControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.fl
11
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
12
  model_id,
13
  controlnet=controlnet,
14
- safety_checker=None, # Disable safety checker for demo purposes
15
  torch_dtype=torch.float32
16
  )
17
  pipe = pipe.to("cpu")
@@ -42,7 +42,7 @@ def generate_image(prompt, control_image, num_inference_steps=25, guidance_scale
42
  )
43
  return result.images[0]
44
 
45
- # Create the Gradio interface.
46
  with gr.Blocks() as demo:
47
  gr.Markdown("# ControlNet Image Generator on CPU\nThis demo uses a ControlNet pipeline (openpose variant) with Stable Diffusion to generate images guided by a control image. Note: Running on CPU can be slow!")
48
 
@@ -50,7 +50,8 @@ with gr.Blocks() as demo:
50
  prompt_input = gr.Textbox(label="Prompt", placeholder="Enter your image prompt here", value="A futuristic cityscape at dusk")
51
 
52
  with gr.Row():
53
- control_image_input = gr.Image(label="Control Image", type="pil", source="upload")
 
54
  output_image = gr.Image(label="Generated Image", type="pil")
55
 
56
  with gr.Row():
 
11
  pipe = StableDiffusionControlNetPipeline.from_pretrained(
12
  model_id,
13
  controlnet=controlnet,
14
+ safety_checker=None,
15
  torch_dtype=torch.float32
16
  )
17
  pipe = pipe.to("cpu")
 
42
  )
43
  return result.images[0]
44
 
45
+
46
  with gr.Blocks() as demo:
47
  gr.Markdown("# ControlNet Image Generator on CPU\nThis demo uses a ControlNet pipeline (openpose variant) with Stable Diffusion to generate images guided by a control image. Note: Running on CPU can be slow!")
48
 
 
50
  prompt_input = gr.Textbox(label="Prompt", placeholder="Enter your image prompt here", value="A futuristic cityscape at dusk")
51
 
52
  with gr.Row():
53
+
54
+ control_image_input = gr.Image(label="Control Image", type="pil")
55
  output_image = gr.Image(label="Generated Image", type="pil")
56
 
57
  with gr.Row():