Diffusers
Safetensors
How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("takuoko/tiny_sd_xl_pokemon_blip", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

Introduction

This is the example model of Distill SDXL. The training is based on DiffEngine, the open-source toolbox for training state-of-the-art Diffusion Models with diffusers and mmengine.

Training

pip install openmim
pip install git+https://github.com/okotaku/diffengine.git
mim train diffengine tiny_sd_xl_pokemon_blip.py

More details to my blog post:

Dataset

I used lambdalabs/pokemon-blip-captions.

Inference

import torch
from diffusers import DiffusionPipeline, UNet2DConditionModel, AutoencoderKL

checkpoint = 'takuoko/tiny_sd_xl_pokemon_blip'
prompt = 'a very cute looking pokemon with a hat on its head'

unet = UNet2DConditionModel.from_pretrained(
    checkpoint, torch_dtype=torch.bfloat16
    )
vae = AutoencoderKL.from_pretrained(
    'madebyollin/sdxl-vae-fp16-fix',
    torch_dtype=torch.bfloat16,
)
pipe = DiffusionPipeline.from_pretrained(
    'stabilityai/stable-diffusion-xl-base-1.0', unet=unet, vae=vae, torch_dtype=torch.bfloat16
    )
pipe.to('cuda')

image = pipe(
    prompt,
    num_inference_steps=50,
).images[0]
image.save('demo.png')

Example result

prompt = 'a very cute looking pokemon with a hat on its head'

image

Reference

Paper: On Architectural Compression of Text-to-Image Diffusion Models

Unofficial implementation: https://github.com/segmind/distill-sd

Downloads last month
16
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train takuoko/tiny_sd_xl_pokemon_blip

Paper for takuoko/tiny_sd_xl_pokemon_blip