Stable Diffusion v1.5 风格迁移实战:照片转油画/水彩/像素风
使用 Stable Diffusion v1.5 模型进行图像风格迁移,核心在于通过文本提示词(Prompt)精确控制生成结果。以下流程基于经典 v1.5 架构,无需复杂命令行,通过 Web 界面即可完成从照片到艺术风格的转换。
1. 环境准备与访问
部署好镜像后,通过浏览器访问控制台提供的地址即可进入 Web 界面。主要操作区域包含提示词输入框、负向提示词设置以及参数调节滑块。
2. 核心操作流程
2.1 提示词构建
提示词是控制生成风格的关键。建议采用结构化英文描述,包含主体、风格和质量修饰。
- 主体描述:明确画面内容,如
a portrait of a woman。 - 风格指令:指定目标风格,例如
oil painting(油画)、watercolor painting(水彩)、pixel art(像素)。 - 质量修饰:提升画质,如
masterpiece, best quality, highly detailed。
示例(人像转油画):
(masterpiece, best quality), a realistic portrait of a young woman in a field, oil painting, thick brushstrokes, vibrant colors, by Greg Rutkowski
注意:模型对英文理解更优,建议使用英文提示词。
2.2 负向提示词
用于排除不想要的元素,减少瑕疵。通用模板如下:
lowres, bad anatomy, wrong hands, missing fingers, extra digit, fewer digits, blurry, mutation, deformed, ugly, poorly drawn face, poorly drawn hands, text, error
可根据需求调整,例如去除写实感可加入 photorealistic, photo。
2.3 参数配置
| 参数 | 作用 | 建议值 |
|---|---|---|
| Steps | 采样迭代次数 | 20-30(风格化建议 25-30) |
| Guidance Scale | 提示词遵循强度 | 7.0-8.0 |
| Width/Height | 分辨率 | 512x512 或 512x768 |
| Seed | 随机种子 | -1(随机),固定后可复现 |
点击 Generate 等待生成即可。
3. 风格案例参考
3.1 梦幻油画风
- 提示词:
(masterpiece, best quality), a beautiful young woman standing in a enchanted forest, sunlight filtering through leaves, oil painting, impasto technique, rich texture, vibrant colors of green and gold, by Thomas Kinkade - 负向提示词:
lowres, blurry, ugly, deformed, photo, realistic - 参数:Steps: 28, Guidance Scale: 7.5, Size: 512x768

