OneDiffusion提示词完全手册:掌握text2image/multiview等10+任务语法
【免费下载链接】OneDiffusionOfficial implementation of OneDiffusion paper (CVPR 2025)项目地址: https://gitcode.com/gh_mirrors/one/OneDiffusion
OneDiffusion是CVPR 2025论文的官方实现,提供了强大的AI绘图功能,支持text2image、multiview等10多种任务。本手册将帮助你快速掌握各种任务的提示词语法,轻松生成高质量图像。
一、基础提示词结构与优化技巧
1.1 提示词基本格式
OneDiffusion的提示词由任务令牌和描述文本两部分组成,基本格式为:
[[任务令牌]] 详细描述文本例如:[[text2image]] A beautiful sunset over the ocean with waves crashing on the shore
1.2 提升图像质量的黄金法则
🌟 详细描述胜过简短提示
模型在训练时使用了大量长文本描述,因此详细的提示词能获得更好效果。建议包含以下元素:
- 主体特征(形状、颜色、材质)
- 环境细节(场景、光线、天气)
- 风格指定(写实、卡通、油画等)
图1:使用详细提示词生成的多样化图像,展现了OneDiffusion对复杂文本的理解能力
📏 分辨率设置指南
- text2image任务:推荐768-1280像素(高度/宽度需为16的倍数)
- 其他任务:512像素左右效果最佳
二、核心任务语法全解析
2.1 文本生成图像(text2image)
任务令牌:[[text2image]]
最佳实践:使用20-50词的详细描述,包含主体、动作、环境和风格信息。
示例:
[[text2image]] A bipedal black cat wearing a huge oversized witch hat, a wizards robe, casting a spell in an enchanted forest. The scene is filled with fireflies and moss on surrounding rocks and trees图2:text2image任务生成的多样化图像,包括天使、机器人、风景等不同主题
2.2 多视角生成(multiview)
任务令牌:[[multiview]]
注意事项:避免描述面部特征(如"直视镜头"),以防生成多脸问题。
示例:
[[multiview]] A cat with orange and white fur sits on a round wooden table. The cat has striking green eyes and a pink nose. Its ears are perked up, and its tail is curled around its body. The background is blurred, showing a white wall, a wooden chair, and a wooden table with a white pot and green plant.图3:multiview任务生成的3D场景多角度视图,展现了同一物体的不同视角
2.3 图像编辑(image_editing)
任务令牌:[[image_editing]]
参数优化:建议将引导尺度(CFG)设置为3-3.5,避免过度饱和。
示例:
[[image_editing]] add sunglasses [[image_editing]] change the cat to a white cat图4:image_editing任务示例,左图添加太阳镜,右图将黑猫改为白猫
2.4 ID定制(faceid)
任务令牌:[[faceid]]
语法结构:
[[faceid]] [[img0]] 目标描述 [[img1]] 源图像1描述 [[img2]] 源图像2描述 [[img3]] 源图像3描述最佳实践:源图像描述建议30-75词,目标描述中加入部分源图像特征有助于保持身份一致性。
示例:
[[faceid]] [[img0]] photo depict a female anime character with pink hair and blue eyes, sitting in a fine dining restaurant, black dress, smiling open mouth widely [[img1]] The photo depicts an anime-style cartoon character of a young woman with pink hair and blue eyes...图5:ID定制任务中不同描述长度对结果的影响,展示了身份特征的保持效果
三、进阶任务与特殊令牌
3.1 语义地图生成(semanticmap2image)
任务令牌:[[semanticmap2image]]
特殊语法:使用颜色掩码指定区域:<#颜色代码 颜色名称 mask: 物体描述>
示例:
[[semanticmap2image]] <#00ffff Cyan mask: dragon> <#ff0000 red mask: bird> <#800080 purple mask: woman> A woman in a red dress with gold floral patterns stands in a traditional Japanese-style building...3.2 主体驱动生成(subject_driven)
任务令牌:[[subject_driven]]
语法结构:
[[subject_driven]] <item: 主体名称> [[img0]] 目标描述 [[img1]] 源图像描述示例:
[[subject_driven]] <item: cartoon dog> [[img0]] a cartoon character resembling a dog, sitting on a beach... [[img1]] The photo features a cartoon character resembling a dog...3.3 深度引导生成(depth2image)
任务令牌:[[depth2image]]
使用技巧:可省略描述文本,仅使用令牌:[[depth2image]]
示例:
[[depth2image]] The image depicts a futuristic astronaut standing on a rocky terrain with orange flowers. The astronaut is wearing a yellow suit with a helmet and is equipped with a backpack...四、任务令牌速查表
| 任务名称 | 任务令牌 | 额外令牌 |
|---|---|---|
| 文本生成图像 | [[text2image]] | - |
| 图像去模糊 | [[deblurring]] | - |
| 图像修复 | [[image_inpainting]] | - |
| 边缘引导生成 | [[canny2image]] | - |
| 深度引导生成 | [[depth2image]] | - |
| 姿态引导生成 | [[pose2image]] | - |
| 图像编辑 | [[image_editing]] | - |
| 语义地图生成 | [[semanticmap2image]] | <#颜色代码 颜色名称 mask: 物体描述> |
| 边界框生成 | [[boundingbox2image]] | <#颜色代码 颜色名称 boundingbox: 物体描述> |
| ID定制 | [[faceid]] | [[img0]]目标描述[[img1]]源图像描述 |
| 多视角生成 | [[multiview]] | - |
| 主体驱动生成 | [[subject_driven]] | <item: 主体名称>[[img0]]目标描述[[img1]]源图像描述 |
五、实用提示与常见问题
5.1 负面提示词设置
默认负面提示词(无需手动添加):
monochrome, greyscale, low-res, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name5.2 推荐参数设置
- CFG值:4.2(文本生成),3-3.5(图像编辑)
- 步数:50步
- 采样器:默认采样器即可获得良好效果
5.3 快速开始指南
- 克隆仓库:
git clone https://gitcode.com/gh_mirrors/one/OneDiffusion - 安装依赖:
pip install -r requirements.txt - 运行演示:
python gradio_demo.py - 在界面中输入提示词,例如:
[[text2image]] your detailed prompt here - 点击"生成图像"按钮
通过本手册,你已经掌握了OneDiffusion所有核心任务的提示词语法。现在就开始创作,探索AI绘图的无限可能吧!无论是文本生成图像、多视角创作还是图像编辑,OneDiffusion都能满足你的创意需求。
【免费下载链接】OneDiffusionOfficial implementation of OneDiffusion paper (CVPR 2025)项目地址: https://gitcode.com/gh_mirrors/one/OneDiffusion
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考