kayfahaarukku commited on
Commit
89165e2
1 Parent(s): f240016

Hotfix lpw not working

Browse files

Unintentionally disabled `from_single_file` because I'm stupid. Will ask

@DamarJati

to fix it later.

Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -30,7 +30,7 @@ OUTPUT_DIR = os.getenv("OUTPUT_DIR", "./outputs")
30
 
31
  MODEL = os.getenv(
32
  "MODEL",
33
- "https://huggingface.co/cagliostrolab/animagine-xl-3.1/blob/main/animagine-xl-3.1.safetensors",
34
  )
35
 
36
  torch.backends.cudnn.deterministic = True
@@ -44,19 +44,13 @@ def load_pipeline(model_name):
44
  "madebyollin/sdxl-vae-fp16-fix",
45
  torch_dtype=torch.float16,
46
  )
47
- pipeline = (
48
- StableDiffusionXLPipeline.from_single_file
49
- if MODEL.endswith(".safetensors")
50
- else StableDiffusionXLPipeline.from_pretrained
51
- )
52
 
53
  pipe = pipeline(
54
  model_name,
55
  vae=vae,
56
  torch_dtype=torch.float16,
57
  custom_pipeline="lpw_stable_diffusion_xl",
58
- use_safetensors=True,
59
- add_watermarker=False,
60
  use_auth_token=HF_TOKEN,
61
  )
62
 
@@ -392,4 +386,4 @@ with gr.Blocks(css="style.css", theme="NoCrypt/miku@1.2.1") as demo:
392
  )
393
 
394
  if __name__ == "__main__":
395
- demo.queue(max_size=20).launch(debug=IS_COLAB, share=IS_COLAB)
 
30
 
31
  MODEL = os.getenv(
32
  "MODEL",
33
+ "cagliostrolab/animagine-xl-3.1",
34
  )
35
 
36
  torch.backends.cudnn.deterministic = True
 
44
  "madebyollin/sdxl-vae-fp16-fix",
45
  torch_dtype=torch.float16,
46
  )
47
+ pipeline = StableDiffusionXLPipeline.from_pretrained
 
 
 
 
48
 
49
  pipe = pipeline(
50
  model_name,
51
  vae=vae,
52
  torch_dtype=torch.float16,
53
  custom_pipeline="lpw_stable_diffusion_xl",
 
 
54
  use_auth_token=HF_TOKEN,
55
  )
56
 
 
386
  )
387
 
388
  if __name__ == "__main__":
389
+ demo.queue(max_size=20).launch(debug=IS_COLAB, share=IS_COLAB)