|
--- |
|
license: apache-2.0 |
|
--- |
|
|
|
# Introduction |
|
|
|
This is the example model of [this PR](https://github.com/okotaku/diffengine/pull/27). |
|
The training is based on [DiffEngine](https://github.com/okotaku/diffengine), the open-source toolbox for training state-of-the-art Diffusion Models with diffusers and mmengine. |
|
|
|
# Dataset |
|
|
|
I used [diffusers/dog-example](https://huggingface.co/datasets/diffusers/dog-example). |
|
|
|
# Inference |
|
|
|
``` |
|
import torch |
|
from diffusers import DiffusionPipeline |
|
|
|
checkpoint = 'takuoko/small-sd-dreambooth-lora-dog' |
|
prompt = 'A photo of sks dog in a bucket' |
|
|
|
pipe = DiffusionPipeline.from_pretrained( |
|
'segmind/small-sd', torch_dtype=torch.float16) |
|
pipe.to('cuda') |
|
pipe.load_lora_weights(checkpoint, weight_name='pytorch_lora_weights.bin') |
|
|
|
image = pipe( |
|
prompt, |
|
num_inference_steps=50, |
|
).images[0] |
|
image.save('demo.png') |
|
``` |
|
|
|
# Example result |
|
|
|
prompt = 'A photo of sks dog in a bucket' |
|
|
|
![image](image0_step_999.png) |
|
![image2](image1_step_999.png) |
|
![image3](image2_step_999.png) |
|
![image4](image3_step_999.png) |
|
|