AIGC:Kolors: Effective Training of Diffusion Model for Photorealistic Text-to-Image Synthesis

代码:GitHub - Kwai-Kolors/Kolors: Kolors Team

论文:Kolors/imgs/Kolors_paper.pdf at master · Kwai-Kolors/Kolors · GitHub

模型:

        huaggingface: https://huggingface.co/Kwai-Kolors/Kolors-diffusers

        modelscope: https://modelscope.cn/models/Kwai-Kolors/Kolors

简介:

Kolors 是由快手 Kolors 团队开发的基于潜在扩散的大规模文本到图像生成模型。它在数十亿的文本 - 图像对上进行训练,在视觉质量、复杂语义准确性以及中文字符和英文字符的文本渲染方面,与开源和专有模型相比具有显著优势。此外,Kolors 支持中文和英文输入,在理解和生成特定于中文的内容方面表现出强大的性能。

使用:

Diffusers(版本 diffusers==0.30.0.dev0)

git clone -b v0.30.0 https://github.com/huggingface/diffusers
cd diffusers
python3 setup.py install

注意:

1:KolorsPipeline 默认使用EulerDiscreteScheduler 作为噪声调度器。我们推荐使用该调度器时搭配 guidance scale=5.0 及 num_inference_steps=50。
2:KolorsPipeline 同时支持 EDMDPMSolverMultistepScheduler。在使用该噪声调度器时,推荐使用参数 guidance scale=5.0及num_inference_steps=25。
3:除了文生图能力,KolorsImg2ImgPipeline 同时也支持图文生图功能。

模型:

# 国内镜像加速
export HF_ENDPOINT=https://hf-mirror.com

huggingface-cli download --resume-download Kwai-Kolors/Kolors-diffusers --local-dir weights/Kolors-diffusers

代码:

import torch

from diffusers import KolorsPipeline

pipe = KolorsPipeline.from_pretrained(
    "Kwai-Kolors/Kolors-diffusers", 
    torch_dtype=torch.float16, 
    variant="fp16"
).to("cuda")

prompt = '一张瓢虫的照片,微距,变焦,高质量,电影,拿着一个牌子,写着"可图"'

image = pipe(
    prompt=prompt,
    negative_prompt="",
    guidance_scale=5.0,
    num_inference_steps=50,
    generator=torch.Generator(pipe.device).manual_seed(66),
).images[0]
image.show()

其他:

1:HuggingFace CLI 安装与使用

参考:HuggingFace CLI 命令全面指南_huggingface-cli-CSDN博客

2:HF-Mirror 安装与使用

参考:https://hf-mirror.com/

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微风❤水墨

你的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值