Instructions to use ByteDance/SDXL-Lightning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ByteDance/SDXL-Lightning with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ByteDance/SDXL-Lightning", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Unable to load unet safetensor
#54
by YifangXu - opened
Dear developer,
When I run code:
unet = UNet2DConditionModel.from_config(sdxl_based_path, subfolder="unet").to(device, torch.float16)
unet_state_dict = load_file(unet_path, device=device)
unet.load_state_dict(unet_state_dict)
I get the error below:
Traceback (most recent call last):
File "/data/xxx/ckpt/load_unet_ckpt.py", line 26, in <module>
unet_state_dict = load_file(unet_path, device=device)
File "/root/anaconda3/envs/xxx/lib/python3.10/site-packages/safetensors/torch.py", line 311, in load_file
with safe_open(filename, framework="pt", device=device) as f:
OSError: No such device (os error 19)
What is your diffusers version?
How can I solve this problem?
YifangXu changed discussion status to closed