🚀 绘画之旅V2
绘画之旅V2是基于V1,在由Midjourney V4、Open Journey V2、Disco Diffusion以及获得授权的艺术家创作的768x768油画上进行微调得到的模型。它能帮助用户生成具有油画效果的图像,在图像生成领域具有独特的应用价值。
🚀 快速开始
在提示词开头加上**((oil painting))** 以添加油画效果。对于数字绘画和其他绘画风格,可使用与Midjourney V4(稍作调整)、Stable Diffusion v1.5(添加更多风格)、Open Journey V2或Disco Diffusion类似的提示词。

✨ 主要特性
- 风格接近人类绘画:Paint Journey V2生成的画作比Open Journey V2更接近人类绘制的艺术作品。
- 高分辨率低噪声:与Dreamlike Diffusion 1.0等模型相比,PJ V2倾向于生成768x768或更高分辨率且噪声水平降低的图像。
- 出色的肖像生成能力:该模型能够使用Camenduru的WebUI生成768x1136分辨率的惊人肖像,且不会出现重复的面部,这对于DreamShaper 3.3等模型来说是一项艰巨的任务。
- 多样化的提示词适应性:通过对文本编码器进行微调,它能将数字和油画风格无缝融合到各种提示词中,输出更自然、动态。
📦 安装指南
Camenduru的WebUI
git clone -b v1.6 https://github.com/camenduru/stable-diffusion-webui
点击使用Automatic1111的Webui,但输出的图像可能没有那么艺术
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
下载检查点和VAE到 ./stable-diffusion-webui/models/Stable-diffusion
文件夹。运行 webui-user.bat
。
Diffusers
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 = "((oil painting)), gentle waves, bright blue sky, white sails billowing, sun glistening on the surface, salty sea air, distant horizon, calm breeze, birds soaring overhead, vibrant colors, artstation digital painting, high resolution, uhd, 4 k, 8k wallpaper"
negative_prompt = "low-res, blurry, haze, dark clouds looming, choppy waves, engine failing, sails tattered, stormy winds".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")
高级用法
在上述基础用法的基础上,你可以根据自己的需求调整提示词、负提示词、种子、图像尺寸、配置比例和推理步数等参数,以生成不同风格和质量的图像。例如,你可以尝试使用更详细的提示词来引导模型生成更符合你期望的图像。
📚 详细文档
示例展示
所有示例均使用Camenduru的WebUI生成(见Colab文件)
👨🎨 768x1136肖像,使用描述性提示词生成,未进行面部修复,生成参数
🌳 1280x768(主要是)自然风景,使用较短的提示词,生成参数
🚀 1152x768外太空风景,使用描述性提示词,生成参数
🚗 1280x768兰博基尼,生成参数
🐾 960x768伊布,生成参数
对比说明
在较低分辨率下,给定相同的(短)正、负提示词,DreamShaper 3.3在噪声水平方面往往会生成比PJ V2更高质量的肖像。然而,PJ V2可以通过更具描述性的正、负提示词创作出更惊人的杰作,并且仍然可以使用较短的提示词生成美丽的风景。
输出尺寸
- 肖像尺寸:包括但不限于
512x768
、768x768
和 768x1136
。
- 风景尺寸:包括但不限于
768x512
、768x768
、1152x768
和 1280x768
。
提示词资源
如果你用完了提示词,可以参考以下有用的资源:Lexica.art、Fast GPT PromptGen、Prompt Hero
安全检查器
官方的稳定扩散安全检查器会占用1.22GB的VRAM。建议使用Google Safesearch Mini V2(220MB)以节省1.0GB的VRAM。
🔧 技术细节
Paint Journey V2并非仅对其Unet进行微调,而是专注于使用各种提示词对其文本编码器进行微调。这使得数字和油画风格能够无缝融入各种其他类型的提示词中,从而产生更自然、动态的输出。该模型在一个精心策划的数据集上进行训练,该数据集大约包含300张从Midjourney、Prompt Hero、PixaBay、Open Journey V2和Reddit中挑选的图像。在训练之前,使用R - ESRGAN 4x对许多图像进行处理,以提高其分辨率并降低噪声。
📄 许可证
本项目采用CreativeML OpenRAIL - M许可证。