Spaces:
Paused
Paused
test gradio
Browse files
app.py
CHANGED
@@ -31,22 +31,20 @@ def generate_image(prompt, reference_image, controlnet_conditioning_scale):
|
|
31 |
control_image=reference_image.resize((512, 512)),
|
32 |
controlnet_conditioning_scale=controlnet_conditioning_scale,
|
33 |
guidance_scale=7.5,
|
34 |
-
)
|
35 |
return generated_image
|
36 |
|
37 |
-
#
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
|
50 |
-
|
51 |
-
# interface.launch()
|
52 |
-
gr.Interface.from_pipeline(pipe).launch()
|
|
|
31 |
control_image=reference_image.resize((512, 512)),
|
32 |
controlnet_conditioning_scale=controlnet_conditioning_scale,
|
33 |
guidance_scale=7.5,
|
34 |
+
).images[0]
|
35 |
return generated_image
|
36 |
|
37 |
+
# Set up Gradio interface
|
38 |
+
interface = gr.Interface(
|
39 |
+
fn=generate_image,
|
40 |
+
inputs=[
|
41 |
+
gr.Textbox(label="Prompt"),
|
42 |
+
gr.Image( type= "pil",label="Reference Image (Style)"),
|
43 |
+
gr.Slider(label="Control Net Conditioning Scale", minimum=0, maximum=1.0, step=0.1, value=0.6),
|
44 |
+
],
|
45 |
+
outputs="image",
|
46 |
+
title="Image Generation with Stable Diffusion 3 medium and ControlNet",
|
47 |
+
description="Generates an image based on a text prompt and a reference image using Stable Diffusion 3 medium with ControlNet."
|
48 |
+
)
|
49 |
|
50 |
+
interface.launch()
|
|
|
|