Dreambooth文本生成图像模型

我要开发同款
匿名用户2024年07月31日
39阅读
所属分类aipytorch、AI作画、文生图、prompt、Stable Diffusion、Dreambooth、MultiModal
开源地址https://modelscope.cn/models/iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis
授权协议MIT License

作品详情

集成中

 README  |  GitHub  |  Models 

Dreambooth on Stable Diffusion 介绍

本模型基于多阶段文本到图像生成扩散模型, 输入描述文本,返回符合文本描述的2D图像,仅支持英语输入

模型描述

介绍该模型的基础信息、模型特征、模型架构等。

期望模型使用方式以及适用范围

本模型适用范围较广,能基于英文文本描述进行推理,生成图像。

如何使用

在ModelScope框架上,提供低分辨图片,即可以通过简单的Pipeline调用来使用图像超分辨率模型。

代码范例

  • Real-CUGAN相对独立的方式实现了ModelScope的接口,因此需要独立安装环境
!git clone https://www.modelscope.cn/damo/cv_dreambooth_stable_diffusion_text-to-image-synthesis.git
%cd cv_dreambooth_stable_diffusion_text-to-image-synthesis
!pip install -r requirements.txt
  • 导入ms_wrapper注册脚本, GPU环境执行
import ms_wrapper

from modelscope.pipelines import pipeline
prompt = 'a photo of a bag'
params = {
    "ddim_steps": 50, 
    "ddim_eta": 0.0, 
    "n_iter": 1, 
    "plms": False, 
    "H": 512,
    "W": 512,
    "C": 4,
    "f": 8,
    "n_samples": 1,
    "n_rows": 0,
    "scale": 10.0,
    "from_file": False,
    "seed": 42,
    "precision": 'autocast',
    "embedding_path": None,
    "skip_grid": False, 
    "skip_save": False, 
    "fixed_code": False, 
    "outdir": 'outputs/txt2img-samples'
}
inference = pipeline('my_db_task', model='.')
output = inference(prompt, **params)
print(output)

模型局限性以及可能的偏差

介绍模型适用的场景,以及在哪些场景可能存在局限性,以及模型在构造训练过程中, 本身可能带有的,由于训练数据以及训练方法等因素引入的偏向性。

数据评估及结果

Regularization images are generated by prompt photo of a container. Regularization images are shown here:

After training, generated images with prompt photo of a sks container:

Generated images with prompt photo of a sks container on the beach:

Generated images with prompt photo of a sks container on the moon:

Some not-so-perfect but still interesting results:

Generated images with prompt photo of a red sks container:

Generated images with prompt a dog on top of sks container:

相关论文以及引用信息

@article{ruiz2022dreambooth,
  title={Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation},
  author={Ruiz, Nataniel and Li, Yuanzhen and Jampani, Varun and Pritch, Yael and Rubinstein, Michael and Aberman, Kfir},
  journal={arXiv preprint arXiv:2208.12242},
  year={2022}
}
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论