Downloads · 30 days
0
Grantedkitty073/dpo-stablediffxl-text2image-v2
dpo-stablediffxl-text2image-v2 is a machine learning model from Grantedkitty073. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers.
Downloads · 30 days
0
Access
Public
Updated Oct 24, 2024
Repo size
10.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors10.3 GB · 100%
From the Hugging Face model README
from diffusers import StableDiffusionXLPipeline, UNet2DConditionModel
import torch
# load pipeline
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
pipe = StableDiffusionXLPipeline.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to("cuda")
# load finetuned model
unet_id = "Grantedkitty073/dpo-sdxl-text2image-v1"
unet = UNet2DConditionModel.from_pretrained(unet_id, subfolder="unet", torch_dtype=torch.float16)
pipe.unet = unet
pipe = pipe.to("cuda")
prompt = "Cute little dog with human body"
image = pipe(prompt, guidance_scale=5).images[0].resize((512,512))
image.save("cutelitledog.png")