Instructions to use ByteDance/Hyper-SD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ByteDance/Hyper-SD with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("ByteDance/Hyper-SD") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Why we have to fuse the LoRA, can we just load lora weights ?
#69
by Adenialzz - opened
Why we have to fuse the LoRA, can we just load lora weights ? I tried but find that it dose not work only loading weights.
pipe.unload_lora_weights()
pipe.load_lora_weights(ckpt_path, cross_attention_kwargs={"scale": 0.125})
# pipe.load_lora_weights(ckpt_path)
seed = 1
image1 = pipe(
prompt="a photo of a cat",
num_inference_steps=20,
guidance_scale=3.5,
generator=torch.Generator(device='cpu').manual_seed(seed)
).images[0]
pipe.fuse_lora(lora_scale=0.125)
image2 = pipe(
prompt="a photo of a cat",
num_inference_steps=20,
guidance_scale=3.5,
generator=torch.Generator(device='cpu').manual_seed(seed)
).images[0]
plot_multi_images([image1, image2], ['before fuse', 'after fuse'])
