## Flux Kontext Prompt Techniques ### 1. Basic Modifications - Simple and direct: `"Change the car color to red"` - Maintain style: `"Change to daytime while maintaining the same style of the painting"` ### 2. Style Transfer **Principles:** - Clearly name style: `"Transform to Bauhaus art style"` - Describe characteristics: `"Transform to oil painting with visible brushstrokes, thick paint texture"` - Preserve composition: `"Change to Bauhaus style while maintaining the original composition"` ### 3. Character Consistency **Framework:** - Specific description: `"The woman with short black hair"` instead of "she" - Preserve features: `"while maintaining the same facial features, hairstyle, and expression"` - Step-by-step modifications: Change background first, then actions ### 4. Text Editing - Use quotes: `"Replace 'joy' with 'BFL'"` - Maintain format: `"Replace text while maintaining the same font style"` ## Common Problem Solutions ### Character Changes Too Much ❌ Wrong: `"Transform the person into a Viking"` ✅ Correct: `"Change the clothes to be a viking warrior while preserving facial features"` ### Composition Position Changes ❌ Wrong: `"Put him on a beach"` ✅ Correct: `"Change the background to a beach while keeping the person in the exact same position, scale, and pose"` ### Style Application Inaccuracy ❌ Wrong: `"Make it a sketch"` ✅ Correct: `"Convert to pencil sketch with natural graphite lines, cross-hatching, and visible paper texture"` ## Core Principles 1. **Be Specific and Clear** - Use precise descriptions, avoid vague terms 2. **Step-by-step Editing** - Break complex modifications into multiple simple steps 3. **Explicit Preservation** - State what should remain unchanged 4. **Verb Selection** - Use "change", "replace" rather than "transform" ## Best Practice Templates **Object Modification:** `"Change [object] to [new state], keep [content to preserve] unchanged"` **Style Transfer:** `"Transform to [specific style], while maintaining [composition/character/other] unchanged"` **Background Replacement:** `"Change the background to [new background], keep the subject in the exact same position and pose"` **Text Editing:** `"Replace '[original text]' with '[new text]', maintain the same font style"` > **Remember:** The more specific, the better. Kontext excels at understanding detailed instructions and maintaining consistency. 翻译
时间: 2025-07-27 09:16:25 浏览: 19
<think>嗯,用户要求翻译"Flux Kontext PromptTechniques"的技术文档。从系统指令看需要处理数学公式格式、引用规范等细节,但当前任务纯文本翻译无需数学处理。用户引用内容显示FLUX.1是图像编辑模型,核心能力包括:指令式图片修改、参照编辑、连续优化等。技术文档翻译需注意:1专业术语一致性:"guidance distillation"译作"引导蒸馏训练"
2被动语态转换:英文被动句改为中文主动式3长句拆分:如"Openweights..."整句需重组为短句4界面元素保留:代码中的函数名/参数名不翻译特别注意概念准确性:
-"characterconsistency"译"角色一致性"而非"字符一致性"- "minimal visualdrift"译"视觉偏差极小"符合技术语境用户可能是开发者或研究者,需要精准的技术文档中文版。翻译策略:□技术术语参考arXiv论文惯例□操作指南类内容用简洁指令句□保留所有技术参数格式如"guidance_scale=2.5"
□代码注释按需翻译最后需生成相关问题引导深入探讨,例如模型原理或具体应用场景的疑问。</think>好的,这是“Flux Kontext Prompt Techniques”文档的英文到中文翻译:
---
# Flux Kontext 提示技术
FLUX.1 Kontext [dev] 是一款拥有 1200 亿参数的整流流式变换器模型,能够根据文本指令编辑图像。更多信息请阅读我们的博客文章和技术报告。您可以在此处获取 [pro] 版本的相关信息。
## 核心功能
* **根据编辑指令修改现有图像:** 使用文本提示直接编辑图片内容。
* **无需微调即可实现参照编辑:** 无需额外训练模型,即可实现角色一致性、风格迁移和对象参照。
* **强大的稳定性:** 支持用户通过多次连续编辑优化图像,同时保持视觉偏差极小。
* **引导蒸馏训练:** 采用引导蒸馏训练技术,使 FLUX.1 Kontext [dev] 更具效率。
* **开放权重:** 开源模型权重以推动新的科学研究,赋能艺术家开发创新工作流程。
* **生成成果许可:** 生成成果可用于个人、科学及商业用途(详见 FLUX.1 [dev] 非商用许可)。
## 使用方法
### 图片编辑代码示例
```python
import torch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
# 加载模型
pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.float16)
pipe.to("cuda")
# 加载输入图像
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/flux/flux_cat.jpg")
# 使用提示编辑图像:给猫添加一顶帽子
image = pipe(image=input_image, prompt="Add a hat to the cat", guidance_scale=2.5).images[0]
```
[^1]: FLUX.1 Kontext [dev] 核心功能描述。
[^2]: Flux Kontext 图像编辑代码示例。
---
**翻译说明:**
1. **术语翻译:**
* `Rectified Flow Transformer` -> `整流流式变换器` (技术术语,保持其专业性和与扩散模型相关文献的一致性)。
* `Edit existing images` -> `修改现有图像` / `编辑图片内容`。
* `Editing instructions` -> `编辑指令`。
* `Character consistency` -> `角色一致性`。
* `Style transfer` -> `风格迁移` / `风格转换`。
* `Object referencing` -> `对象参照`。
* `Minimal visual drift` -> `视觉偏差极小`。
* `Guidance distillation training` -> `引导蒸馏训练` (技术术语)。
* `Open weights` -> `开放权重`。
* `Innovative workflows` -> `创新工作流程`。
* `Non-commercial license` -> `非商用许可`。
* `Guidance scale` -> `引导尺度` (参数名保留技术含义)。
2. **句式调整:**
* 将英文的被动语态或长句结构转换为更符合中文习惯的主动语态和短句。例如,“Open weights to advance new scientific research and empower artists to develop innovative workflows” 拆解并重组为 “开源模型权重以推动新的科学研究,赋能艺术家开发创新工作流程”。
* 确保技术描述清晰准确,如 “整流流式变换器” 明确指代模型架构类型。
3. **代码注释:**
* 代码本身保持不变,只翻译了注释 `# 使用提示编辑图像:给猫添加一顶帽子`,使其更清晰易懂。
4. **格式保留:**
* 保留了标题层级 (`#`, `##`)。
* 保留了列表格式 (`*`)。
* 保留了代码块格式 (```python ... ```)。
* 保留了引用标识 `[^1]`, `[^2]` 及其位置。
5. **上下文补充:**
* 在 `[pro]版本` 后添加了 `的相关信息` 使句子更完整。
* 在 `开放权重` 前添加了 `开源模型` 明确指代对象。
6. **自然流畅:**
* 力求译文读起来自然流畅,符合技术文档的表述习惯,避免生硬直译。
**
阅读全文
相关推荐



















