---
title: portraitplus
canonical_url: "https://www.modelscope.cn/models/dienstag/portraitplus"
md_url: "https://www.modelscope.cn/models/dienstag/portraitplus.md"
repository: dienstag/portraitplus
chinese_name: "人像生成模型plus"
last_updated: 2023-02-15
license: creativeml-openrail-m
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
parameters: 1.1B
tensor_type:
  - F16
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 385
stars: 20
tags:
  - "text2image generation"
  - "stablediffusion model"
  - "stable diffusion"
  - "文到图"
  - "文生图"
  - "生成"
  - "图片生成"
  - "生成图片"
  - "ai作画"
  - "作画ai"
  - "作画"
---

# portraitplus

> portraitplus - dienstag 在 ModelScope 开源的模型。输出中近距离的人像照片；微调自Stable Diffusion

dienstag/portraitplus 是 ModelScope 魔搭社区上的 1.1B 参数text-to-image-synthesis模型，采用 creativeml-openrail-m 许可。

- **Repository**: dienstag/portraitplus
- **License**: creativeml-openrail-m
- **Tasks**: text-to-image-synthesis
- **Parameters**: 1.1B
- **Tags**: text2image generation, stablediffusion model, stable diffusion, 文到图, 文生图, 生成, 图片生成, 生成图片, ai作画, 作画ai, 作画
- **Downloads**: 385
- **Stars**: 20
- **Last updated**: 2023-02-15

Source: https://www.modelscope.cn/models/dienstag/portraitplus

---

**Portrait+**

![Header](imgs/page1.jpg)

本模型利用dreambooth方法微调Stable Diffusion 1.5而来，数据集为中近距离的人像照片。

在prompt中加入`portrait+ style`以实现该效果（建议加在开头）。


该模型的目标是输出具有构图和眼睛一致性的人像照片。详情请参考下面的示例图像，注意人物的眼睛都是一致的。这个模型可以输出多种风格，所以你要根据你的目标来引导它。输出明星人像的工作方式与输出一般人物的工作方式有些不同，因为Stable Diffusion 1.5-base模型对于真人更倾向于输出真实照片的风格。还要注意的是，虚构作品中的概念，如赛博朋克人或巫师，将需要比普通的人（如公园里的普通人）更严格的提示逼真的文字。

Portrait+ 能输出各种长宽比的图像，但是 在1:1的长宽比下效果最好。

样例图像的参数（prompt, sampler, seed, *etc.*）请参考[本文件](parameters_for_samples.txt)。




![Modification example](imgs/page2.jpg)

![Batch example](imgs/batchgrid.jpg)




## 使用方法：

```python
from modelscope.utils.constant import Tasks
from modelscope.pipelines import pipeline
import cv2

pipe = pipeline(task=Tasks.text_to_image_synthesis, 
                model='dienstag/portraitplus',
                model_revisino='v1.0')

prompt = 'portrait+ style photograph of Emma Watson as Hermione Granger'
negative_prompt = 'blender illustration hdr'
output = pipe({'text': prompt, 'negative_prompt': negative_prompt})
cv2.imwrite('result.png', output['output_imgs'][0])
```
