sdxl-turbo-lora

我要开发同款
匿名用户2024年07月31日
93阅读

技术信息

开源地址
https://modelscope.cn/models/jahson/sdxl-turbo-lora

作品详情

DPO LoRA Stable Diffusio XL Turbo

Model traied with LoRA implemetatio of Diffusio DPO Read more here

Base Model: https://hf-mirror.com/stabilityai/sdxl-turbo

Ruig with ? diffusers library

from diffusers import DiffusioPipelie
from diffusers.utils import make_image_grid
import torch

pipe = DiffusioPipelie.from_pretraied(
    "stabilityai/sdxl-turbo",
    torch_dtype=torch.float16, variat="fp16"
)
pipe.to("cuda")
pipe.load_lora_weights("radames/sdxl-turbo-DPO-LoRA", adapter_ame="dpo-lora-sdxl-turbo")
pipe.set_adapters(["dpo-lora-sdxl-turbo"], adapter_weights=[1.0]) # you ca play with adapter_weights to icrease the effect of the LoRA model
seed = 123123
prompt = " A photo of beautiful moutai with realistic suset ad blue lake, highly detailed, masterpiece"
egative_prompt = "3d reder, cartoo, drawig, art, low light, blur, pixelated, low resolutio, black ad white, old photo, blurry faces"
geerator = torch.Geerator().maual_seed(seed)
images = pipe(
    prompt=prompt,
    egative_prompt=egative_prompt,
    width=512,
    height=512,
    um_iferece_steps=2,
    geerator=geerator,
    guidace_scale=1.0,
    um_images_per_prompt=4
).images
make_image_grid(images, 1, 4)

shiroppo/sdxlturbo_lora

|sdxlturbolorav1-128dim.safetesors |787 MB| |sdxlturbolorav1-16dim.safetesors |98.7 MB| |sdxlturbolorav1-64dim.safetesors |394 MB|

LoRA based o Stability AI SDXL-Turbo, for more iformatio o the mai model: https://hf-mirror.com/stabilityai/sdxl-turboxyz_grid-0015-2494203713-20231201144837.pg

Diffusers pip istall diffusers trasformers accelerate --upgrade

Text-to-image:

import torch
from diffusers import LCMScheduler, AutoPipelieForText2Image

model_id = "stabilityai/stable-diffusio-xl-base-1.0"
adapter_id = "shiroppo/sd_xl_turbo_lora"

pipe = AutoPipelieForText2Image.from_pretraied(model_id, torch_dtype=torch.float16, variat="fp16")
pipe.scheduler = LCMScheduler.from_cofig(pipe.scheduler.cofig)
pipe.to("cuda")

pipe.load_lora_weights(adapter_id)
pipe.fuse_lora()

prompt = "the_prompt"

image = pipe(prompt=prompt, um_iferece_steps=4, guidace_scale=0).images[0]

lcm-lora-sdxl-turbo

功能介绍

DPO LoRA Stable Diffusion XL Turbo Model trained with LoRA implementation of Diffusion DPO Read more

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论