Spaces:
Runtime error
Runtime error
imports
Browse files
app.py
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
import torch
|
2 |
import gradio as gr
|
3 |
-
from diffusers.
|
4 |
-
from diffusers.
|
5 |
-
from diffusers.models.controlnet_flux import FluxControlNetModel
|
6 |
from controlnet_aux import CannyDetector
|
7 |
|
8 |
base_model = 'black-forest-labs/FLUX.1-dev'
|
9 |
controlnet_model = 'YishaoAI/flux-dev-controlnet-canny-kid-clothes'
|
10 |
|
11 |
-
controlnet =
|
12 |
-
pipe =
|
13 |
pipe.enable_model_cpu_offload()
|
14 |
pipe.to("cuda")
|
15 |
|
|
|
1 |
import torch
|
2 |
import gradio as gr
|
3 |
+
from diffusers.pipelines.flux.pipeline_flux import FluxPipeline
|
4 |
+
from diffusers.models.controlnet import ControlNetModel
|
|
|
5 |
from controlnet_aux import CannyDetector
|
6 |
|
7 |
base_model = 'black-forest-labs/FLUX.1-dev'
|
8 |
controlnet_model = 'YishaoAI/flux-dev-controlnet-canny-kid-clothes'
|
9 |
|
10 |
+
controlnet = ControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.float16)
|
11 |
+
pipe = FluxPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.float16)
|
12 |
pipe.enable_model_cpu_offload()
|
13 |
pipe.to("cuda")
|
14 |
|