LPX55 commited on
Commit
366a699
·
verified ·
1 Parent(s): eb1e114

Update optimized.py

Browse files
Files changed (1) hide show
  1. optimized.py +2 -1
optimized.py CHANGED
@@ -6,7 +6,7 @@ from diffusers import FluxControlNetModel, FluxControlNetPipeline, AutoencoderKL
6
  import gradio as gr
7
  huggingface_token = os.getenv("HUGGINFACE_TOKEN")
8
 
9
- good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16, token=huggingface_token).to("cuda")
10
 
11
  # Load pipeline
12
  controlnet = FluxControlNetModel.from_pretrained(
@@ -19,6 +19,7 @@ pipe = FluxControlNetPipeline.from_pretrained(
19
  torch_dtype=torch.bfloat16,
20
  device_map="auto",
21
  vae=good_vae,
 
22
  token=huggingface_token
23
  )
24
  # Add to your pipeline initialization:
 
6
  import gradio as gr
7
  huggingface_token = os.getenv("HUGGINFACE_TOKEN")
8
 
9
+ good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16, use_safetensors=True, token=huggingface_token).to("cuda")
10
 
11
  # Load pipeline
12
  controlnet = FluxControlNetModel.from_pretrained(
 
19
  torch_dtype=torch.bfloat16,
20
  device_map="auto",
21
  vae=good_vae,
22
+ use_safetensors=True,
23
  token=huggingface_token
24
  )
25
  # Add to your pipeline initialization: