Spaces:
Runtime error
Runtime error
float type mismatch
Browse files
app.py
CHANGED
@@ -42,11 +42,16 @@ base = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
42 |
repo = "ByteDance/SDXL-Lightning"
|
43 |
ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your step setting!
|
44 |
|
45 |
-
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
|
47 |
-
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet
|
48 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
49 |
-
pipe = pipe.to(device)
|
50 |
|
51 |
# Load resadapter
|
52 |
pipe.load_lora_weights(
|
|
|
42 |
repo = "ByteDance/SDXL-Lightning"
|
43 |
ckpt = "sdxl_lightning_4step_unet.safetensors" # Use the correct ckpt for your step setting!
|
44 |
|
45 |
+
# unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda", torch.float16)
|
46 |
+
# unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
|
47 |
+
# pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet, torch_dtype=torch.float16, variant="fp16")
|
48 |
+
# pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
49 |
+
# pipe = pipe.to(device)
|
50 |
+
|
51 |
+
unet = UNet2DConditionModel.from_config(base, subfolder="unet").to("cuda")
|
52 |
unet.load_state_dict(load_file(hf_hub_download(repo, ckpt), device="cuda"))
|
53 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(base, unet=unet).to("cuda")
|
54 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
|
|
55 |
|
56 |
# Load resadapter
|
57 |
pipe.load_lora_weights(
|