许可协议:creativeml-openrail-m
语言:
- 英语
标签:
- 文本生成图像
- Midjourney
- Stable Diffusion
- Disco Diffusion
- 艺术
- arxiv:2208.12242
推理支持:是
库名称:diffusers
Paint Journey V2 是在 V1 基础上,针对 Midjourney V4、Open Journey V2、Disco Diffusion 及授权艺术家的 768x768 油画作品进行微调的模型
在提示词开头添加 ((油画)) 以启用油画效果。对于数字绘画或其他风格,可采用类似 Midjourney V4(需微调)、Stable Diffusion v1.5(需添加更多风格描述)、Open Journey V2 或 Disco Diffusion 的提示词策略。

示例
所有示例均通过Camenduru的WebUI生成(参见Colab文件)

‚¨ÜÔ∏è 768x1136 肖像,使用描述性提示词生成且未启用面部修复,生成参数

‚¨ÜÔ∏è 1280x768(多数)自然景观,使用简短提示词,生成参数

‚¨ÜÔ∏è 1152x768 太空景观,使用描述性提示词,生成参数

‚¨ÜÔ∏è 1280x768 兰博基尼,生成参数

‚¨ÜÔ∏è 960x768 伊布,生成参数
对比
Paint Journey V2 的绘画效果比 Open Journey V2 更接近人类手绘艺术。
相较于 Dreamlike Diffusion 1.0 等模型,PJ V2 倾向于生成 768x768 或更高分辨率图像且噪点更低。
该模型还能在 768x1136 分辨率下生成无重复面部的惊艳肖像(配合 Camenduru's WebUI),这对 DreamShaper 3.3 等模型是困难任务。
在较低分辨率下,使用相同(简短)正负提示词时,DreamShaper 3.3 生成的肖像噪点控制优于 PJ V2。
但 PJ V2 可通过更丰富的正负提示词创作更震撼的作品,且仍能用简短提示生成优美风景。
训练
Paint Journey V2 不仅微调了 Unet,更着重通过多样化提示词微调文本编码器。
这种设计实现了数字与油画风格与其他提示类型的自然融合,产出更具动态感的作品。
训练数据集包含约 300 张精选图像,来源包括 Midjourney、Prompt Hero、PixaBay、Open Journey V2 和 Reddit。训练前对多数图像使用 R-ESRGAN 4x 提升分辨率并降噪。
缺乏灵感?
实用资源:Lexica.art、Fast GPT PromptGen、Prompt Hero
输出尺寸
肖像尺寸包括但不限于 512x768
、768x768
和 768x1136
。
风景尺寸包括但不限于 768x512
、768x768
、1152x768
和 1280x768
。
Camenduru's WebUI
git clone -b v1.6 https://github.com/camenduru/stable-diffusion-webui
点击使用 Automatic1111's Webui(但艺术效果可能稍逊)
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
将 模型文件 和 VAE 下载至 ./stable-diffusion-webui/models/Stable-diffusion
文件夹,运行 webui-user.bat
。
üß® Diffusers
技巧:用双/三/四层括号强调关键词(如"((WORD))")
pip install --upgrade diffusers transformers
from diffusers import StableDiffusionPipeline, EulerAncestralDiscreteScheduler
import torch, random, datetime
pipe = StableDiffusionPipeline.from_pretrained("FredZhang7/paint-journey-v2")
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
def random_seed():
return random.randint(0, 2**32 - 1)
prompt = "((油画)),轻柔波浪,蔚蓝晴空,白帆鼓荡,阳光在水面闪烁,咸涩海风,遥远地平线,和煦微风,飞鸟掠过,鲜艳色彩,artstation数字绘画,高清,UHD,4K,8K壁纸"
negative_prompt = "低分辨率,模糊,雾霾,乌云密布,汹涌波浪,引擎故障,破旧船帆,暴风雨".split(",")
seed = random_seed()
width, height = 1280, 768
cfg_scale = 7.5
num_inference_steps = 40
generator = torch.Generator("cuda").manual_seed(seed)
with torch.autocast("cuda"):
image = pipe(prompt=prompt,
num_inference_steps=num_inference_steps,
width=width, height=height,
generator=generator,
guidance_scale=cfg_scale).images[0]
def generate_filename(string, seed):
invalid_chars = ["<", ">", ":", '"', "/", "\\", "|", "?", "*"]
for char in invalid_chars:
string = string.replace(char, "")
return f"{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}_{seed}_{string}"
image.save(f"./{generate_filename(prompt, seed)}.png")
安全检测器 V2
官方 stable diffusion安全检测器 占用 1.22GB 显存。
推荐使用 Google Safesearch Mini V2(220MB)节省 1.0GB 显存。