haz un resumen inteligente, ordenado y esquematico de lo que hace este lora: ""News🔥🔥🔥
Aug.26, 2024. 💥💥💥 Our 8-steps and 16-steps FLUX.1-dev-related LoRAs are available now! We recommend LoRA scales around 0.125 that is adaptive with training and guidance scale could be kept on 3.5. Lower step LoRAs would be coming soon. 💥💥💥
Aug.19, 2024. SD3-related CFG LoRAs are available now! We recommend setting guidance scale to 3.0/5.0/7.0 at 4/8/16-steps. Don't forget to fuse lora with a relatively small scale (e.g. 0.125 that is adaptive with training) before inference with diffusers. Note that 8-steps and 16-steps LoRA can also inference on a little bit smaller steps like 6-steps and 12-steps, respectively. Hope to hear your feedback, FLUX-related models will be coming next week.
May.13, 2024. The 12-Steps CFG-Preserved Hyper-SDXL-12steps-CFG-LoRA and Hyper-SD15-12steps-CFG-LoRA is also available now(support 58 guidance scales), this could be more practical with better trade-off between performance and speed. Enjoy!
Apr.30, 2024. Our 8-Steps CFG-Preserved Hyper-SDXL-8steps-CFG-LoRA and Hyper-SD15-8steps-CFG-LoRA is available now(support 58 guidance scales), we strongly recommend making the 8-step CFGLora a standard configuration for all SDXL and SD15 models!!!
Apr.28, 2024. ComfyUI workflows on 1-Step Unified LoRA 🥰 with TCDScheduler to inference on different steps are released! Remember to install ⭕️ ComfyUI-TCD in your ComfyUI/custom_nodes folder!!! You're encouraged to adjust the eta parameter to get better results 🌟!
Apr.26, 2024. Thanks to @Pete for contributing to our scribble demo with larger canvas right now 👏.
Apr.24, 2024. The ComfyUI workflow and checkpoint on 1-Step SDXL UNet ✨ is also available! Don't forget ⭕️ to install the custom scheduler in your ComfyUI/custom_nodes folder!!!
Apr.23, 2024. ComfyUI workflows on N-Steps LoRAs are released! Worth a try for creators 💥!
Apr.23, 2024. Our technical report 📚 is uploaded to arXiv! Many implementation details are provided and we welcome more discussions👏.
Apr.21, 2024. Hyper-SD ⚡️ is highly compatible and work well with different base models and controlnets. To clarify, we also append the usage example of controlnet here.
Apr.20, 2024. Our checkpoints and two demos 🤗 (i.e. SD15-Scribble and SDXL-T2I) are publicly available on HuggingFace Repo.
Try our Hugging Face demos:
Hyper-SD Scribble demo host on 🤗 scribble
Hyper-SDXL One-step Text-to-Image demo host on 🤗 T2I
Introduction
Hyper-SD is one of the new State-of-the-Art diffusion model acceleration techniques. In this repository, we release the models distilled from FLUX.1-dev, SD3-Medium, SDXL Base 1.0 and Stable-Diffusion v1-5。
Checkpoints
Hyper-FLUX.1-dev-Nsteps-lora.safetensors: Lora checkpoint, for FLUX.1-dev-related models.
Hyper-SD3-Nsteps-CFG-lora.safetensors: Lora checkpoint, for SD3-related models.
Hyper-SDXL-Nstep-lora.safetensors: Lora checkpoint, for SDXL-related models.
Hyper-SD15-Nstep-lora.safetensors: Lora checkpoint, for SD1.5-related models.
Hyper-SDXL-1step-unet.safetensors: Unet checkpoint distilled from SDXL-Base.
Text-to-Image Usage
FLUX.1-dev-related models
import torch
from diffusers import FluxPipeline
from huggingface_hub import hf_hub_download
base_model_id = "black-forest-labs/FLUX.1-dev"
repo_name = "ByteDance/Hyper-SD"
Load model, please fill in your access tokens since SD3 repo is a gated model.
pipe = StableDiffusion3Pipeline.from_pretrained(base_model_id, token="xxx")
pipe.load_lora_weights(hf_hub_download(repo_name, ckpt_name))
pipe.fuse_lora(lora_scale=0.125)
pipe.to("cuda", dtype=torch.float16)
image=pipe(prompt="a photo of a cat", num_inference_steps=8, guidance_scale=5.0).images[0]
image.save("output.png")
SDXL-related models
2-Steps, 4-Steps, 8-steps LoRA
Take the 2-steps LoRA as an example, you can also use other LoRAs for the corresponding inference steps setting.
import torch
from diffusers import DiffusionPipeline, DDIMScheduler
from huggingface_hub import hf_hub_download
base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
repo_name = "ByteDance/Hyper-SD"
Set start timesteps to 800 in the one-step inference to get better results
prompt="a photo of a cat"
image=pipe(prompt=prompt, num_inference_steps=1, guidance_scale=0, timesteps=[800]).images[0]
SD1.5-related models
2-Steps, 4-Steps, 8-steps LoRA
Take the 2-steps LoRA as an example, you can also use other LoRAs for the corresponding inference steps setting.
import torch
from diffusers import DiffusionPipeline, DDIMScheduler
from huggingface_hub import hf_hub_download
base_model_id = "runwayml/stable-diffusion-v1-5"
repo_name = "ByteDance/Hyper-SD"
Lower eta results in more detail for multi-steps inference
eta=1.0
image = pipe("a blue paradise bird in the jungle", num_inference_steps=1, image=control_image, guidance_scale=0, eta=eta).images[0]
image.save('image_out.png')
Comfyui Usage
Hyper-SDXL-Nsteps-lora.safetensors: text-to-image workflow
Hyper-SD15-Nsteps-lora.safetensors: text-to-image workflow
Hyper-SDXL-1step-Unet-Comfyui.fp16.safetensors: text-to-image workflow
REQUIREMENT / INSTALL for 1-Step SDXL UNet: Please install our scheduler folder into your ComfyUI/custom_nodes to enable sampling from 800 timestep instead of 999.
i.e. making sure the ComfyUI/custom_nodes/ComfyUI-HyperSDXL1StepUnetScheduler folder exist.
For more details, please refer to our technical report.
Hyper-SD15-1step-lora.safetensors: text-to-image workflow
Hyper-SDXL-1step-lora.safetensors: text-to-image workflow
REQUIREMENT / INSTALL for 1-Step Unified LoRAs: Please install the ComfyUI-TCD into your ComfyUI/custom_nodes to enable TCDScheduler with support of different inference steps (1~8) using single checkpoint.
i.e. making sure the ComfyUI/custom_nodes/ComfyUI-TCD folder exist.
You're encouraged to adjust the eta parameter in TCDScheduler to get better results.
Citation
@misc{ren2024hypersd,
title={Hyper-SD: Trajectory Segmented Consistency Model for Efficient Image Synthesis},
author={Yuxi Ren and Xin Xia and Yanzuo Lu and Jiacheng Zhang and Jie Wu and Pan Xie and Xing Wang and Xuefeng Xiao},
year={2024},
eprint={2404.13686},
archivePrefix={arXiv},
primaryClass={cs.CV}
}""
Resumen de LoRA: Hyper-SD para Modelos de Difusión Estable
1. Introducción
Hyper-SD es una técnica de aceleración de modelos de difusión de vanguardia, diseñada para optimizar la generación de imágenes mediante LoRAs (Low-Rank Adaptations). Este conjunto de LoRAs está distilado a partir de modelos como FLUX.1-dev, SD3-Medium, SDXL Base 1.0 y Stable-Diffusion v1-5, ofreciendo flexibilidad en pasos de inferencia y escalas de guía para equilibrar rendimiento y velocidad.
2. Histórico de Actualizaciones
Agosto 2024
26: Lanzamiento de LoRAs relacionados con FLUX.1-dev con 8 y 16 pasos. Recomiendan una escala LoRA de ~0.125 y escala de guía de 3.5.
19: Disponibilidad de CFG LoRAs relacionados con SD3. Guías de escala recomendadas: 3.0/5.0/7.0 para 4/8/16 pasos.
Mayo 2024
13: Lanzamiento de LoRAs Hyper-SDXL-12steps-CFG y Hyper-SD15-12steps-CFG con soportes de escala de guía de 5~8.
Abril 2024
Varias actualizaciones enfocadas en la integración con ComfyUI, lanzamiento de workflows para diferentes pasos de LoRA, y disponibilidad de modelos y demos en HuggingFace.
23: Publicación del informe técnico en arXiv.
3. Modelos y Checkpoints Disponibles
Para FLUX.1-dev:
Hyper-FLUX.1-dev-Nsteps-lora.safetensors
Para SD3:
Hyper-SD3-Nsteps-CFG-lora.safetensors
Para SDXL:
Hyper-SDXL-Nstep-lora.safetensors
Hyper-SDXL-1step-unet.safetensors
Para SD1.5:
Hyper-SD15-Nstep-lora.safetensors
4. Guías de Uso
Texto a Imagen
Carga de Modelo:
Utilizar la función from_pretrained de diffusers para cargar el modelo base.
Aplicar load_lora_weights para incorporar los pesos de la LoRA.
Fusionar la LoRA con fuse_lora(lora_scale=0.125).
Parámetros Recomendados:
Escala LoRA: ~0.125
Escala de Guía: Varía según el modelo y los pasos (e.g., 3.5 para FLUX.1-dev a 7.0 para SD3).
Ejemplo de Inferencia:
image = pipe(prompt="a photo of a cat", num_inference_steps=8, guidance_scale=3.5).images[0]
image.save("output.png")
Inference con Diferentes Pasos (2, 4, 8, 16)
Flexibilidad: Los LoRAs de 8 y 16 pasos pueden inferirse en pasos menores como 6 y 12, respectivamente.
Schedulers Recomendados:
DDIMScheduler: Para pasos específicos.
TCDScheduler: Para una mejor calidad de imagen y ajuste de parámetros eta.
Unified LoRA
Soporte: Adaptable para 1 a 8 pasos de inferencia.
Ajustes: Flexibilidad para modificar pasos de inferencia y el parámetro eta para optimizar resultados.
5. Integración con ControlNet
Uso con ControlNet:
Preparación de Imagen de Control:
Aplicar detección de bordes (e.g., Canny) a la imagen original.
Convertir la imagen procesada en tres canales.
Configuración del Pipeline:
Cargar ControlNetModel preentrenado.
Incorporar la LoRA correspondiente (e.g., Hyper-SDXL-2steps-lora.safetensors).
Ajustar control_weight para balancear la influencia del ControlNet.
@misc{ren2024hypersd,
title={Hyper-SD: Trajectory Segmented Consistency Model for Efficient Image Synthesis},
author={Yuxi Ren and Xin Xia and Yanzuo Lu and Jiacheng Zhang and Jie Wu and Pan Xie and Xing Wang and Xuefeng Xiao},
year={2024},
eprint={2404.13686},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
9. Conclusión
Hyper-SD ofrece una solución robusta y flexible para la generación eficiente de imágenes utilizando LoRAs adaptadas a múltiples modelos de difusión. Con soporte para diversos pasos de inferencia, escalas de guía ajustables y una integración fluida con herramientas como ControlNet y ComfyUI, Hyper-SD se posiciona como una herramienta esencial para creadores y desarrolladores en el ámbito de la generación de imágenes por IA.