Spaces:
Paused
Paused
test gradio
Browse files
app.py
CHANGED
@@ -3,16 +3,15 @@ import torch
|
|
3 |
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
|
4 |
|
5 |
# Load Stable Diffusion model and ControlNet reference-only model
|
6 |
-
model_id = "
|
7 |
controlnet_id = "lllyasviel/control_v11p_sd15_inpaint" # Use an appropriate ControlNet variant
|
8 |
|
9 |
-
# Initialize the pipeline on CPU
|
10 |
controlnet = ControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.float32)
|
11 |
pipeline = StableDiffusionControlNetPipeline.from_pretrained(
|
12 |
model_id,
|
13 |
controlnet=controlnet,
|
14 |
torch_dtype=torch.float32
|
15 |
-
)
|
16 |
|
17 |
# Define the Gradio interface function
|
18 |
def generate_image(prompt, reference_image):
|
|
|
3 |
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
|
4 |
|
5 |
# Load Stable Diffusion model and ControlNet reference-only model
|
6 |
+
model_id = "stabilityai/stable-diffusion-3.5-large-turbo"
|
7 |
controlnet_id = "lllyasviel/control_v11p_sd15_inpaint" # Use an appropriate ControlNet variant
|
8 |
|
|
|
9 |
controlnet = ControlNetModel.from_pretrained(controlnet_id, torch_dtype=torch.float32)
|
10 |
pipeline = StableDiffusionControlNetPipeline.from_pretrained(
|
11 |
model_id,
|
12 |
controlnet=controlnet,
|
13 |
torch_dtype=torch.float32
|
14 |
+
)
|
15 |
|
16 |
# Define the Gradio interface function
|
17 |
def generate_image(prompt, reference_image):
|