Instruction-tuning Stable Diffusion with InstructPix2Pix
Fine-tuning InstructPix2Pix on FLAN-style instruction-prompted datasets teaches Stable Diffusion to follow specific image transformation instructions such as cartoonization and low-level image processing (deraining, denoising, deblurring, low-light enhancement). The cartoonization dataset pairs 5,000 Imagenette images with Whitebox CartoonGAN outputs and 50 ChatGPT-generated instruction paraphrases, and the low-level dataset mixes samples from REDS, Rain13k, SIDD and LOL into a single multi-task set. Starting from an InstructPix2Pix checkpoint adapted faster than starting from base Stable Diffusion. Cartoonization and deraining results clearly beat the pre-trained model, while low-light enhancement and deblurring stayed weak, likely because those tasks had very few training samples. The results are preliminary, and open questions on dataset scale, task mixture and ControlNet alternatives remain.
Related posts
- Open Preference Dataset for Text-to-Image Generation by the 🤗 Community
Hugging Face easyNoviceData is Better Together released an Apache 2.0 text-to-image preference dataset of 10K pairs, with over 30K annotations from more than 250 community members collected in under two weeks. Imgsys prompts were deduplicated, filtered for NSFW content with text and image classifiers plus manual review, and rewritten with distilabel across style categories and simple versus complex variants. Images came from FLUX.1-dev and Stable Diffusion 3.5 Large. Annotators found FLUX better for anime, manga and 3D, and SD3.5 better for cinematic and art styles. A LoRA fine-tune of FLUX-dev on the chosen samples improved its weaker art and cinematic outputs.
- Open-sourcing Knowledge Distillation Code and Weights of SD-Small and SD-Tiny
Hugging Face mediumAdeptSegmind releases training code and weights for SD-Small and SD-Tiny, Stable Diffusion variants compressed by block-removal knowledge distillation that cut UNet parameters by 35% and 55% while keeping image fidelity close to the base model. The student is trained with three losses: the standard latent diffusion loss, an output-matching loss against the teacher (Realistic-Vision 4.0), and a per-block feature-level loss. Training used 1M LAION Art Aesthetic images scoring above 7.5. The distilled models run up to 2x faster at inference but are early-stage and weak at composition, so they work best fine-tuned or LoRA-trained on specific styles. A portrait fine-tune of SD-Tiny is included with its hyperparameters.
- Finetune Stable Diffusion Models with DDPO via TRL
Hugging Face hardMasterDenoising Diffusion Policy Optimization (DDPO) fine-tunes diffusion models with reinforcement learning by treating the full denoising process as a multistep MDP. Because each step's policy is an isotropic Gaussian, it can use exact per-step likelihoods, unlike reward-weighted regression, which stacks approximations, and it then applies PPO with customized trajectory collection. TRL's new DDPOTrainer lets you fine-tune Stable Diffusion against a CLIP-based aesthetic reward model, needs at least an A100, and ships recommended single-GPU hyperparameters. LoRA training is stable and generalizes across prompts even with a small prompt set; full fine-tuning can give more intricate images but needs a low learning rate (~1e-5) and careful tuning.
- Create an infinite icon library by fine-tuning Stable Diffusion
Modal mediumAdept
Stable Diffusion v1.5 is fully fine-tuned on the ~300-icon Heroicons set to generate new icons in a similar black-and-white line style. Captions are derived from icon names like "golden-retriever" or "barack-obama". The walkthrough covers choosing between full, sequential-adapter and parallel-adapter (LoRA) fine-tuning, then preparing the data: rasterizing SVGs to PNG, adding white backgrounds, and building a metadata.csv of captions. Training uses the Diffusers train_text_to_image script on an A100 via Modal, with 4000 steps, learning rate 1e-5, batch size 1 and 128px resolution. Weights are saved to a Modal Volume and served on a cheaper A10G behind a Gradio UI, and dataset preparation proved the hardest and most important part.
- LoRA training scripts of the world, unite!
Hugging Face hardMasterCombining Pivotal Tuning (textual inversion of newly inserted tokens, then LoRA fine-tuning) with the adaptive Prodigy optimizer produces strong SDXL Dreambooth LoRA results, and both are now available in a diffusers training script. The guide covers the relevant flags and recommended values: stopping textual inversion halfway through training, Prodigy with learning_rate=1.0 and bias correction, and separate text encoder and UNet learning rates. It also covers custom BLIP captions, Min-SNR gamma of 5.0, image repeats, prior preservation loss and dataset curation tips for faces and objects. Experiments on a 31-image Huggy mascot dataset compare batch sizes, optimizers and text encoder training modes.