---
title: cv_dreambooth_stable_diffusion_text-to-image-synthesis
canonical_url: "https://www.modelscope.cn/models/iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis"
md_url: "https://www.modelscope.cn/models/iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis.md"
repository: iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis
chinese_name: "Dreambooth文本生成图像模型"
last_updated: 2022-12-21
license: "MIT License"
library_name:
  - pytorch
frameworks:
  - pytorch
domain:
  - MultiModal
downloads: 61
stars: 0
tags:
  - Dreambooth
  - "Stable Diffusion"
  - prompt
  - "文生图"
  - "AI作画"
---

# cv_dreambooth_stable_diffusion_text-to-image-synthesis

> cv_dreambooth_stable_diffusion_text-to-image-synthesis - iic 在 ModelScope 开源的模型。集成中 &nbsp README &nbsp | &nbsp GitHub &nbsp | &nbsp Models &nbsp

iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis 是 ModelScope 魔搭社区上的机器学习模型，采用 MIT License 许可。

- **Repository**: iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis
- **License**: MIT License
- **Tags**: Dreambooth, Stable Diffusion, prompt, 文生图, AI作画
- **Downloads**: 61
- **Stars**: 0
- **Last updated**: 2022-12-21

Source: https://www.modelscope.cn/models/iic/cv_dreambooth_stable_diffusion_text-to-image-synthesis

---

# 集成中
<p align="center">
         &nbsp<a href="https://github.com/XavierXiao/Dreambooth-Stable-Diffusion/blob/main/README.md">README</a>&nbsp | &nbsp<a href="https://github.com/XavierXiao/Dreambooth-Stable-Diffusion">GitHub</a>&nbsp | &nbsp<a href="https://huggingface.co/CompVis">Models</a>&nbsp
</p>


# Dreambooth on Stable Diffusion 介绍

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

## 模型描述

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


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

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

### 如何使用

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

#### 代码范例

- Real-CUGAN相对独立的方式实现了ModelScope的接口，因此需要独立安装环境
```python
!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环境执行
```python
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:

![](assets/a-container-0038.jpg)

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

![](assets/photo-of-a-sks-container-0018.jpg)

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

![](assets/photo-of-a-sks-container-on-the-beach-0017.jpg)

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

![](assets/photo-of-a-sks-container-on-the-moon-0016.jpg)

Some not-so-perfect but still interesting results:

Generated images with prompt ```photo of a red sks container```:

![](assets/a-red-sks-container-0021.jpg)

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

![](assets/a-dog-on-top-of-sks-container-0023.jpg)



### 相关论文以及引用信息

```BibTeX
@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}
}
```
