tori29umai commited on
Commit
c7df0ab
1 Parent(s): d472855
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -28,15 +28,10 @@ load_lora_model(lora_dir)
28
  def load_model(lora_dir, cn_dir):
29
  device = "cuda" if torch.cuda.is_available() else "cpu"
30
  dtype = torch.float16
31
- model = "cagliostrolab/animagine-xl-3.1"
32
- scheduler = AutoencoderKL.from_pretrained(model, subfolder="scheduler")
33
  controlnet = ControlNetModel.from_pretrained(cn_dir, torch_dtype=dtype, use_safetensors=True)
34
  pipe = StableDiffusionXLControlNetImg2ImgPipeline.from_pretrained(
35
- model,
36
- controlnet=controlnet,
37
- torch_dtype=dtype,
38
- use_safetensors=True,
39
- scheduler=scheduler,
40
  )
41
  # pipe.load_lora_weights(lora_dir, weight_name="sdxl_BWLine.safetensors")
42
  pipe = pipe.to(device)
 
28
  def load_model(lora_dir, cn_dir):
29
  device = "cuda" if torch.cuda.is_available() else "cpu"
30
  dtype = torch.float16
31
+ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
 
32
  controlnet = ControlNetModel.from_pretrained(cn_dir, torch_dtype=dtype, use_safetensors=True)
33
  pipe = StableDiffusionXLControlNetImg2ImgPipeline.from_pretrained(
34
+ "cagliostrolab/animagine-xl-3.1", controlnet=controlnet, vae=vae, torch_dtype=torch.float16
 
 
 
 
35
  )
36
  # pipe.load_lora_weights(lora_dir, weight_name="sdxl_BWLine.safetensors")
37
  pipe = pipe.to(device)