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
| import comfy.samplers | |
| import comfy.sample | |
| from comfy.k_diffusion import sampling as k_diffusion_sampling | |
| import latent_preview | |
| import torch | |
| import comfy.utils | |
| class HyperSDXL1StepUnetScheduler: | |
| def INPUT_TYPES(s): | |
| return {"required": | |
| {"model": ("MODEL",), | |
| "steps": ("INT", {"default": 1, "min": 1, "max": 10}), | |
| } | |
| } | |
| RETURN_TYPES = ("SIGMAS",) | |
| CATEGORY = "sampling/custom_sampling/schedulers" | |
| FUNCTION = "get_sigmas" | |
| def get_sigmas(self, model, steps): | |
| timesteps = torch.tensor([800]) | |
| sigmas = model.model.model_sampling.sigma(timesteps) | |
| sigmas = torch.cat([sigmas, sigmas.new_zeros([1])]) | |
| return (sigmas, ) | |
| NODE_CLASS_MAPPINGS = { | |
| "HyperSDXL1StepUnetScheduler": HyperSDXL1StepUnetScheduler, | |
| } | |