Run this model with HF Jobs
Run ByteDance/Hyper-SD on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ByteDance/Hyper-SD. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ByteDance/Hyper-SD on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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 Settings
- 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'])
