Instructions to use PhaiModelLab/Phai-M1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use PhaiModelLab/Phai-M1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("PhaiModelLab/Phai-M1", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Sync prompt_enhancement/enhancement_instructions_zh.md from ModelScope
Browse files
prompt_enhancement/enhancement_instructions_zh.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 视频生成提示词改写规则
|
| 2 |
+
|
| 3 |
+
## 核心要点
|
| 4 |
+
- 提示词应涵盖镜头类型、场景、动作、角色、运镜及音频。连续镜头采用单镜头描述,对话密集的场景采用剧本格式。
|
| 5 |
+
- 多镜头提示词(2–4 次切镜)需明确描述镜头转场方式、每个镜头的构图。
|
| 6 |
+
|
| 7 |
+
## 提示词的六个关键要素
|
| 8 |
+
忽略任意一个都会导致生成低质量的视频。
|
| 9 |
+
|
| 10 |
+
### 镜头与场景——确定首帧画面
|
| 11 |
+
镜头指摄影景别,如远景、中近景、过肩镜头。场景指画面中的视觉元素,包括光照、色彩、表面纹理等。这两者共同确定运动开始前的首帧画面。
|
| 12 |
+
- **正例**: "A photorealistic, wide low-angle shot frames a rain-soaked Tokyo back alley at midnight, neon signs reflecting in every puddle, steam rising from a street vent."
|
| 13 |
+
|
| 14 |
+
### 动作——删繁就简
|
| 15 |
+
想象自己像一名舞台指导,严格按照发生的顺序描述镜头中最重要的动作,省略那些对于画面主体影响很小的运动。
|
| 16 |
+
- **正例**: "He sets his glass down hard on the counter, the ice rattling, then turns toward the door as it swings open behind him."
|
| 17 |
+
|
| 18 |
+
### 角色描绘——描述具体的肢体表现,而非抽象的情绪标签。
|
| 19 |
+
描述年龄、发型、服装及外貌特征(仅包含镜头实际可见的信息)。表达情绪时,应描述具体的肢体或面部表现,而非直接使用情绪标签。
|
| 20 |
+
- **反例**: "She looks sad about the news."
|
| 21 |
+
- **正例**: "Her shoulders drop, she exhales slowly and looks away from the phone screen."
|
| 22 |
+
|
| 23 |
+
### 镜头运动——不仅描述如何移动,更要说明揭示了什么
|
| 24 |
+
不要只写“镜头移动”。应明确镜头何时开始运动、如何运动,以及运动结束后呈现的画面。“时机—运动—画面揭示”这一三段式结构,是确保镜头效果一致的关键。
|
| 25 |
+
|
| 26 |
+
### 音频——最容易忽略的要素
|
| 27 |
+
忽略音频描述并不意味着静音,反而可能导致模型生成错误的声音。只需一句话描述环境音或背景音乐即可。**除非明确要求,否则不要添加对白**。
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## 推荐词表
|
| 31 |
+
|
| 32 |
+
### 类别
|
| 33 |
+
**动画**: Stop-motion, 2D / 3D animation, Claymation, Hand-drawn \
|
| 34 |
+
**风格化**: Comic book, Cyberpunk, 8-bit pixel, Surreal, Minimalist, Painterly, Illustrated \
|
| 35 |
+
**电影风格**: Period drama, Film noir, Fantasy, Epic space opera, Thriller, Modern romance, Experimental film, Arthouse, Documentary
|
| 36 |
+
|
| 37 |
+
### 视觉细节
|
| 38 |
+
**打光**: Flickering candles, Neon glow, Natural sunlight, Dramatic shadows \
|
| 39 |
+
**质感**: Rough stone, Smooth metal, Worn fabric, Glossy surfaces \
|
| 40 |
+
**配色**: Vibrant, Muted, Monochromatic, High contrast
|
| 41 |
+
|
| 42 |
+
### 技术风格
|
| 43 |
+
**镜头语言**: Follows, Tracks, Pans across, Circles around, Tilts upward, Pushes in / pulls back, Overhead view, Handheld movement, Over-the-shoulder, Wide establishing shot, Static frame \
|
| 44 |
+
**影像质感**: Film grain, Lens flares, Pixelated edges, Jittery stop-motion \
|
| 45 |
+
**尺度**: Expansive, Epic, Intimate, Claustrophobic \
|
| 46 |
+
**时间感**: Slow motion, Time-lapse, Rapid cuts, Lingering shot, Continuous shot, Freeze-frame, Fade-in / fade-out, Seamless transition, Sudden stop \
|
| 47 |
+
**视觉特效**: Particle systems, Motion blur, Depth of field
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
## 中英对照词典
|
| 51 |
+
|
| 52 |
+
### 视频风格:
|
| 53 |
+
- 真人 / 写实 → "photorealistic live-action"
|
| 54 |
+
- 半写实 → "semi-realistic"
|
| 55 |
+
- 风格化写实 → "stylized-realism" or "anime-influenced characters"
|
| 56 |
+
- Q 版角色 → "chibi-proportioned feature-animation cartoon characters"
|
| 57 |
+
- 卡通(哪吒式) → "a feature-animation cartoon style"
|
| 58 |
+
- 手绘质感 → "a painterly 3D style with hand-painted textures"
|
| 59 |
+
- 大量特效 → "with extensive visual effects"
|
| 60 |
+
- CG(非国漫) → "CG 3D animation"
|
| 61 |
+
- 3D漫剧 → "Chinese 3D short-drama animation"
|
| 62 |
+
- 国漫 → "Chinese 3D animation"
|
| 63 |
+
- 玩具感3D → "toy-like 3D animation with soft, rounded characters"
|
| 64 |
+
- 2D日漫/动画 → "2D anime-style animation with cel-shaded characters"
|
| 65 |
+
|
| 66 |
+
### 设定:
|
| 67 |
+
- 古装(无超自然、无战争) → "in an ancient Chinese setting"
|
| 68 |
+
- 古装战争(有军队、盔甲、战场) → "in an ancient Chinese war setting"
|
| 69 |
+
- 武侠 → "in a wuxia setting"
|
| 70 |
+
- 仙侠 / 修仙 → "in a xianxia setting"
|
| 71 |
+
- 玄幻 / 东方奇幻 → "in an Eastern fantasy setting"
|
| 72 |
+
- 神话(哪吒式) → "with rounded, exaggerated characters from Chinese mythology"
|
| 73 |
+
- 科幻 → "in a science fiction setting"
|
| 74 |
+
- 西方奇幻(精灵、异域) → "in a fantasy setting"
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
## 提示
|
| 78 |
+
- 避免使用“传统服饰”或“古典建筑”这类模糊的描述。请明确指出其具体来源,例如“中国传统服饰”或“意大利古典建筑”。
|
| 79 |
+
- 如果用户没有说明人物角色的国籍,请根据用户语言来推测、补全角色的国籍,但**绝不能**和用户明确提及的内容产生冲突。
|
| 80 |
+
- 仅描述画面中实际存在的内容。若某元素缺失,直接忽略即可,无需特意说明(例如,不要写“没有对话”、“没有字幕”或“没有背景音乐”)。
|
| 81 |
+
- ���非是同时发生的多个动作,否则多使用时间连词来构造清晰的动作顺序。
|
| 82 |
+
- **千万不要**被用户的提示词格式影响,严格遵守规则。
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
## 最终检查
|
| 86 |
+
- [ ] 提示词应直接以人物、场景或动作描写开头。
|
| 87 |
+
- [ ] 避免复杂句式和生僻词汇,使用初中生能理解的简单英语。
|
| 88 |
+
- [ ] 除非用户明确要求,否则避免使用多镜头提示词。
|
| 89 |
+
- [ ] 提示词中不得使用镜头列表(如 Shot N、Cut N 等)、特殊符号或时间戳。
|
| 90 |
+
- [ ] 提示词必须涵盖全部[六大关键要素](#提示词的六个关键要素)。
|
| 91 |
+
- [ ] 不要指定场景时长,让模型自动决定。
|
| 92 |
+
- [ ] 使用英语编写提示词,**但对白的内容要用原始语言**。
|