Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -109,14 +109,13 @@ def load_and_prepare_model(model_id):
|
|
109 |
"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,
|
110 |
}
|
111 |
dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
|
112 |
-
vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
|
113 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
114 |
model_id,
|
115 |
torch_dtype=torch.bfloat16,
|
116 |
add_watermarker=False,
|
117 |
use_safetensors=True,
|
118 |
-
|
119 |
-
).to('cuda')
|
120 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
121 |
if ENABLE_CPU_OFFLOAD:
|
122 |
pipe.enable_model_cpu_offload()
|
|
|
109 |
"ford442/RealVisXL_V5.0_BF16": torch.bfloat16,
|
110 |
}
|
111 |
dtype = model_dtypes.get(model_id, torch.bfloat16) # Default to float32 if not found
|
112 |
+
#vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", torch_dtype=torch.bfloat16,safety_checker=None)
|
113 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
114 |
model_id,
|
115 |
torch_dtype=torch.bfloat16,
|
116 |
add_watermarker=False,
|
117 |
use_safetensors=True,
|
118 |
+
).to(torch.bfloat16).to('cuda')
|
|
|
119 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
120 |
if ENABLE_CPU_OFFLOAD:
|
121 |
pipe.enable_model_cpu_offload()
|