Mobil-DataLab commited on
Commit
badaa39
1 Parent(s): 1f0327b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import torch
2
  from controlnet_aux import CannyDetector
3
- from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
4
  from diffusers.utils import load_image
5
  import gradio as gr
6
  import random
@@ -17,12 +17,9 @@ os.system("pip install -U diffusers controlnet_aux mediapipe")
17
  MAX_SEED = 2**32 - 1
18
  MAX_IMAGE_SIZE = 1024
19
 
20
- # Inicialización del modelo ControlNet
21
- controlnet = ControlNetModel.from_pretrained(
22
  "black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.float16
23
- )
24
- pipe = StableDiffusionControlNetPipeline.from_pretrained(
25
- "CompVis/stable-diffusion-v1-4", controlnet=controlnet, torch_dtype=torch.float16
26
  ).to("cuda" if torch.cuda.is_available() else "cpu")
27
 
28
  # Procesador Canny
 
1
  import torch
2
  from controlnet_aux import CannyDetector
3
+ from diffusers import FluxControlPipeline
4
  from diffusers.utils import load_image
5
  import gradio as gr
6
  import random
 
17
  MAX_SEED = 2**32 - 1
18
  MAX_IMAGE_SIZE = 1024
19
 
20
+ # Inicialización del pipeline Flux Canny Dev
21
+ pipe = FluxControlPipeline.from_pretrained(
22
  "black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.float16
 
 
 
23
  ).to("cuda" if torch.cuda.is_available() else "cpu")
24
 
25
  # Procesador Canny