# FLUX.1

{% hint style="info" %}
**更快的替代方案！** [**FLUX.2 Klein**](/guides/guides_v2-zh/tu-xiang-sheng-cheng/flux2-klein.md) 可在 < 0.5 秒内生成图像（相比之下，FLUX.1 需要 10–30 秒），且质量相当。本指南对于 LoRA 训练和 ControlNet 工作流仍然适用。
{% endhint %}

Black Forest Labs 在 CLORE.AI GPU 上的最先进图像生成模型。

{% hint style="success" %}
所有示例都可以在通过以下方式租用的 GPU 服务器上运行： [CLORE.AI 市场](https://clore.ai/marketplace).
{% endhint %}

## 为什么选择 FLUX.1？

* **最佳质量** - 优于 SDXL 和 Midjourney v5
* **文本渲染** - 图像中真正可读的文字
* **提示词遵循** - 优秀的指令遵从性
* **快速变体** - FLUX.1-schnell 用于快速生成

## 模型变体

| 模型             | 速度       | 质量 | VRAM  | 许可证        |
| -------------- | -------- | -- | ----- | ---------- |
| FLUX.1-schnell | 快速（4 步）  | 很好 | 12GB+ | Apache 2.0 |
| FLUX.1-dev     | 中等（20 步） | 优秀 | 16GB+ | 非商业用途      |
| FLUX.1-pro     | 仅限 API   | 最佳 | -     | 商业用途       |

## 在 CLORE.AI 上快速部署

**Docker 镜像：**

```
ghcr.io/huggingface/text-generation-inference:latest
```

**端口：**

```
22/tcp
7860/http
```

为了最简单的部署，请使用 **带有 FLUX 节点的 ComfyUI**.

## 安装方法

### 方法 1：ComfyUI（推荐）

```bash
# 安装 ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install -r requirements.txt

# 下载 FLUX 模型
cd models/unet
wget https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/flux1-schnell.safetensors

# 下载所需组件
cd ../clip
wget https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
wget https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors

cd ../vae
wget https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors

# 运行 ComfyUI
python main.py --listen 0.0.0.0
```

### 方法 2：Diffusers

```bash
pip install diffusers transformers accelerate torch

python << 'PYEOF'
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

image = pipe(
    "一只穿着太空服的猫在火星上",
    num_inference_steps=4,
    guidance_scale=0.0,
).images[0]

image.save("flux_output.png")
PYEOF
```

### 方法 3：Fooocus

Fooocus 内置了 FLUX 支持：

```bash
git clone https://github.com/lllyasviel/Fooocus
cd Fooocus
pip install -r requirements.txt

# 将 FLUX 模型下载到 models/checkpoints/
python launch.py --listen
```

## ComfyUI 工作流

### FLUX.1-schnell（快速）

需要的节点：

1. **加载扩散模型** → flux1-schnell.safetensors
2. **DualCLIPLoader** → clip\_l.safetensors + t5xxl\_fp16.safetensors
3. **CLIP 文本编码** → 你的提示词
4. **空 SD3 潜空间图像** → 设置尺寸
5. **KSampler** → 步数：4，cfg：1.0
6. **VAE 解码** → ae.safetensors
7. **保存图像**

### FLUX.1-dev（质量）

相同工作流，但：

* 步数：20-50
* CFG：3.5
* 在提示词中使用 guidance\_scale

## Python API

### 基础生成

```python
import torch
from diffusers import FluxPipeline

# 加载模型
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.bfloat16
)
pipe.to("cuda")

# 生成
image = pipe(
    prompt="一座宁静的日本庭院，樱花盛开",
    height=1024,
    width=1024,
    num_inference_steps=4,
    guidance_scale=0.0,
).images[0]

image.save("output.png")
```

### 使用内存优化

```python
from diffusers import FluxPipeline
import torch

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.bfloat16
)

# 启用优化
pipe.enable_model_cpu_offload()  # 节省约 10GB 显存
pipe.enable_vae_slicing()
pipe.enable_vae_tiling()

image = pipe(
    "赛博朋克武士肖像",
    height=1024,
    width=1024,
    num_inference_steps=4,
).images[0]
```

### 批量生成

```python
prompts = [
    "群山上的日落",
    "夜晚的未来城市",
    "水下珊瑚礁",
]

images = pipe(
    prompts,
    height=1024,
    width=1024,
    num_inference_steps=4,
).images

for i, img in enumerate(images):
    img.save(f"output_{i}.png")
```

## FLUX.1-dev（更高质量）

```python
from diffusers import FluxPipeline
import torch

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

image = pipe(
    prompt="一位老渔夫的超写实肖像",
    height=1024,
    width=1024,
    num_inference_steps=50,
    guidance_scale=3.5,
).images[0]
```

## 提示词技巧

### FLUX 擅长：

* **图像中的文字**: "一个写着 'OPEN 24/7' 的霓虹灯招牌"
* **复杂场景**: "夜晚繁忙的东京街道，带有反光"
* **特定风格**: "莫奈风格的油画"
* **详细描述**: 长而详细的提示词效果很好

### 示例提示词

```
# 照片写实
一张专业摄影作品：一只金毛幼犬在秋叶中玩耍， 
浅景深，温暖的午后光线，Canon EOS R5

# 艺术风格
一幅雨中的巴黎咖啡馆印象派绘画， 
布面油画，可见笔触，暖色调

# 文本渲染
一张复古电影海报，标题 "COSMIC VOYAGE" 以粗体复古字母呈现，
20 世纪 60 年代科幻美学，宇航员插画

# 复杂场景
一个舒适的图书馆内部，书架直达天花板， 
壁炉旁有一把皮扶手椅，窗外可见雨景，
温暖的灯光，照片写实
```

## 内存优化

### 适用于 12GB 显存（RTX 3060）

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.float16  # 使用 fp16 代替 bf16
)
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()
pipe.enable_vae_tiling()

# 以较低分辨率生成
image = pipe(prompt, height=768, width=768, num_inference_steps=4).images[0]
```

### 适用于 8GB 显存

使用量化版本或带 GGUF 的 ComfyUI：

```bash
# 在 ComfyUI 中安装 GGUF 节点
cd custom_nodes
git clone https://github.com/city96/ComfyUI-GGUF

# 下载量化模型
wget https://huggingface.co/city96/FLUX.1-schnell-gguf/resolve/main/flux1-schnell-Q4_K_S.gguf
```

## 性能对比

| 模型             | 步数 | 时间（4090） | 质量 |
| -------------- | -- | -------- | -- |
| FLUX.1-schnell | 4  | \~3 秒    | 很好 |
| FLUX.1-dev     | 20 | \~12 秒   | 优秀 |
| FLUX.1-dev     | 50 | \~30 秒   | 最佳 |
| SDXL           | 30 | \~8 秒    | 良好 |

## GPU 要求

| 设置             | 最低   | 推荐    |
| -------------- | ---- | ----- |
| FLUX.1-schnell | 12GB | 16GB+ |
| FLUX.1-dev     | 16GB | 24GB+ |
| 启用 CPU 卸载      | 8GB  | 12GB+ |
| 量化（GGUF）       | 6GB  | 8GB+  |

## GPU 预设

### RTX 3060 12GB（预算型）

```python
# 使用量化模型
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()

# 设置：
# - 仅 schnell（dev 可能显存溢出）
# - 512x512 到 768x768
# - 4 步
# - 批量大小 1
```

### RTX 3090 24GB（最佳）

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.float16
)
pipe.to("cuda")
pipe.enable_vae_tiling()

# 设置：
# - schnell：1024x1024，批量 2
# - dev：1024x1024，批量 1
# - dev 使用 20-30 步
# - 高分辨率时启用 VAE 平铺
```

### [RTX 4090 24GB](https://clore.ai/rent-4090.html?utm_source=docs\&utm_medium=guide\&utm_campaign=flux) （性能）

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.float16
)
pipe.to("cuda")

# 设置：
# - schnell：1024x1024，批量 4
# - dev：1024x1024，批量 2
# - 最佳质量使用 30-50 步
# - 通过平铺可处理 1536x1536
```

### A100 40GB/80GB（生产）

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16
)
pipe.to("cuda")

# 设置：
# - schnell：1024x1024，批量 8+
# - dev：1024x1024，批量 4
# - 50 步可获得最高质量
# - 可实现 2048x2048
```

## 成本估算

| GPU           | 每小时     | 张/小时            |
| ------------- | ------- | --------------- |
| RTX 3060 12GB | \~$0.03 | \~200（schnell）  |
| RTX 3090 24GB | \~$0.06 | \~600（schnell）  |
| RTX 4090 24GB | \~$0.10 | \~1000（schnell） |
| A100 40GB     | \~$0.17 | \~1500（schnell） |

## 故障排查

### 内存不足

```python
# 使用 CPU 卸载
pipe.enable_model_cpu_offload()

# 或顺序 CPU 卸载（更慢但更省显存）
pipe.enable_sequential_cpu_offload()

# 降低分辨率
height=768, width=768
```

### 生成缓慢

* 使用 FLUX.1-schnell（4 步）
* 启用 torch.compile： `pipe.unet = torch.compile(pipe.unet)`
* 在较旧 GPU 上使用 fp16 而不是 bf16

### 质量较差

* 使用更多步数（FLUX-dev：30-50）
* 提高 guidance\_scale（dev 建议 3.0-4.0）
* 写更详细的提示词

***

## FLUX LoRA

LoRA（低秩适配）权重允许你在不重新训练整个模型的情况下，针对特定风格、角色或概念对 FLUX 进行微调。HuggingFace 和 CivitAI 上提供了数百个社区 LoRA。

### 安装

```bash
pip install diffusers transformers accelerate peft
```

### 加载单个 LoRA

```python
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

# 从本地文件加载 LoRA 权重
pipe.load_lora_weights("path/to/lora.safetensors")

image = pipe(
    "一幅梵高风格的肖像，旋转的笔触",
    num_inference_steps=20,
    guidance_scale=3.5,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]
image.save("flux_lora_output.png")
```

### 从 HuggingFace Hub 加载

```python
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

# 直接从 HuggingFace 仓库加载 LoRA
pipe.load_lora_weights(
    "username/my-flux-lora",          # HF 仓库 ID
    weight_name="my_lora.safetensors" # 仓库中的文件名
)

image = pipe(
    "trigger_word 一幅美丽的风景",
    num_inference_steps=20,
    guidance_scale=3.5,
).images[0]
image.save("output.png")
```

### LoRA 比例（强度）

```python
# 使用 cross_attention_kwargs 控制 LoRA 影响
image = pipe(
    "一个赛博朋克角色，霓虹灯",
    num_inference_steps=20,
    guidance_scale=3.5,
    cross_attention_kwargs={"scale": 0.8},  # 0.0 = 无效果，1.0 = 完全效果
).images[0]
```

### 组合多个 LoRA

```python
from diffusers import FluxPipeline
import torch

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

# 加载第一个 LoRA
pipe.load_lora_weights(
    "path/to/style_lora.safetensors",
    adapter_name="style"
)

# 加载第二个 LoRA
pipe.load_lora_weights(
    "path/to/character_lora.safetensors",
    adapter_name="character"
)

# 使用权重组合
pipe.set_adapters(["style", "character"], adapter_weights=[0.7, 0.9])

image = pipe(
    "character_trigger 穿着华丽服装，artistic_trigger 风格",
    num_inference_steps=25,
    guidance_scale=3.5,
).images[0]
image.save("combined_lora.png")
```

### 卸载 LoRA

```python
# 移除 LoRA 权重以恢复基础模型
pipe.unload_lora_weights()
```

### 训练你自己的 FLUX LoRA

```bash
# 使用 kohya-ss 或 ai-toolkit 进行 FLUX LoRA 训练
git clone https://github.com/ostris/ai-toolkit
cd ai-toolkit
pip install -r requirements.txt

# 准备数据集：10-30 张带标题的图像
# 编辑 config YAML，然后：
python run.py config/flux_lora_train.yaml
```

### 推荐的 LoRA 来源

| 来源          | 网址                    | 说明        |
| ----------- | --------------------- | --------- |
| CivitAI     | civitai.com           | 大型社区资源库   |
| HuggingFace | huggingface.co/models | 按 FLUX 过滤 |
| Replicate   | replicate.com         | 浏览已训练模型   |

***

## 适用于 FLUX 的 ControlNet

ControlNet 允许使用边缘、深度图和姿态骨架等结构化输入来引导 FLUX 生成。XLabs-AI 已发布首批专为 FLUX.1 设计的 ControlNet 模型。

### 安装

```bash
pip install diffusers transformers accelerate controlnet-aux pillow
```

### FLUX ControlNet Canny（XLabs-AI）

```python
import torch
import numpy as np
from PIL import Image
from diffusers import FluxControlNetPipeline, FluxControlNetModel
from diffusers.utils import load_image
from controlnet_aux import CannyDetector

# 加载 FLUX ControlNet 模型（Canny 变体）
controlnet = FluxControlNetModel.from_pretrained(
    "XLabs-AI/flux-controlnet-canny-diffusers",
    torch_dtype=torch.bfloat16
)

# 使用 ControlNet 加载管线
pipe = FluxControlNetPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    controlnet=controlnet,
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

# 准备控制图像（Canny 边缘）
input_image = load_image("your_input.jpg").resize((1024, 1024))
canny = CannyDetector()
control_image = canny(input_image, low_threshold=50, high_threshold=200)

# 在 ControlNet 引导下生成
image = pipe(
    prompt="一座带霓虹灯招牌的未来城市景观，照片写实，8K",
    control_image=control_image,
    controlnet_conditioning_scale=0.7,
    num_inference_steps=25,
    guidance_scale=3.5,
    generator=torch.Generator(device="cuda").manual_seed(0),
).images[0]

image.save("controlnet_flux_output.png")
```

### FLUX ControlNet Depth

```python
import torch
from PIL import Image
from diffusers import FluxControlNetPipeline, FluxControlNetModel
from diffusers.utils import load_image
from transformers import pipeline as hf_pipeline

# 加载深度估计器
depth_estimator = hf_pipeline("depth-estimation", model="LiheYoung/depth-anything-small-hf")

# 准备深度图
input_image = load_image("portrait.jpg").resize((1024, 1024))
depth_result = depth_estimator(input_image)["depth"]
depth_image = depth_result.convert("RGB")

# 加载 ControlNet Depth
controlnet = FluxControlNetModel.from_pretrained(
    "XLabs-AI/flux-controlnet-depth-diffusers",
    torch_dtype=torch.bfloat16
)

pipe = FluxControlNetPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    controlnet=controlnet,
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

image = pipe(
    prompt="一尊战士的大理石雕像，戏剧性灯光，博物馆照片",
    control_image=depth_image,
    controlnet_conditioning_scale=0.6,
    num_inference_steps=20,
    guidance_scale=3.5,
).images[0]
image.save("depth_controlnet_output.png")
```

### FLUX 的 Multi-ControlNet

```python
import torch
from diffusers import FluxControlNetPipeline, FluxMultiControlNetModel, FluxControlNetModel
from diffusers.utils import load_image
from controlnet_aux import CannyDetector

# 加载多个 ControlNet
controlnet_canny = FluxControlNetModel.from_pretrained(
    "XLabs-AI/flux-controlnet-canny-diffusers",
    torch_dtype=torch.bfloat16
)
controlnet_depth = FluxControlNetModel.from_pretrained(
    "XLabs-AI/flux-controlnet-depth-diffusers",
    torch_dtype=torch.bfloat16
)

# 合并为 MultiControlNet
multi_controlnet = FluxMultiControlNetModel([controlnet_canny, controlnet_depth])

pipe = FluxControlNetPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    controlnet=multi_controlnet,
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

image = pipe(
    prompt="一位身穿盔甲站在森林中的骑士，戏剧性灯光",
    control_image=[canny_image, depth_image],
    controlnet_conditioning_scale=[0.7, 0.5],
    num_inference_steps=25,
    guidance_scale=3.5,
).images[0]
```

### 可用的 FLUX ControlNet 模型

| 模型            | 仓库                                          | 使用场景   |
| ------------- | ------------------------------------------- | ------ |
| Canny         | XLabs-AI/flux-controlnet-canny-diffusers    | 边缘引导生成 |
| Depth         | XLabs-AI/flux-controlnet-depth-diffusers    | 深度引导生成 |
| HED/Soft Edge | XLabs-AI/flux-controlnet-hed-diffusers      | 柔和结构控制 |
| Pose          | XLabs-AI/flux-controlnet-openpose-diffusers | 姿态引导肖像 |

### ControlNet 提示

* **conditioning\_scale 0.5–0.8** 对 FLUX 效果最好（太高会失去创造性）
* 使用 **1024×1024** 或其倍数以获得最佳质量
* 与 LoRA 结合，实现风格 + 结构控制
* 在使用 ControlNet 时，较低步数（20–25）通常已足够

***

## FLUX.1-schnell：快速生成模式

FLUX.1-schnell 是 FLUX 的蒸馏版、速度优化版本。它只需 **4 步** （相比 FLUX.1-dev 的 20–50 步）即可生成高质量图像，非常适合快速原型设计和高吞吐工作流。

### 与 FLUX.1-dev 的主要区别

| 特性              | FLUX.1-schnell          | FLUX.1-dev |
| --------------- | ----------------------- | ---------- |
| 步数              | 4                       | 20–50      |
| 速度（4090）        | \~3 秒                   | \~12–30 秒  |
| 许可证             | **Apache 2.0** （免费商业使用） | 非商业用途      |
| guidance\_scale | 0.0（无 CFG）              | 3.5        |
| 质量              | 很好                      | 优秀         |
| VRAM            | 12GB+                   | 16GB+      |

> **许可证说明：** FLUX.1-schnell 采用 Apache 2.0 许可证——你可以免费将其用于商业产品。FLUX.1-dev 需要向 Black Forest Labs 另行获取商业许可证。

### 快速开始

```python
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

image = pipe(
    prompt="纽约市在黄金时刻的震撼航拍视图，照片写实",
    height=1024,
    width=1024,
    num_inference_steps=4,   # 只需要 4 步！
    guidance_scale=0.0,       # schnell 禁用 CFG
    max_sequence_length=256,
    generator=torch.Generator(device="cpu").manual_seed(0),
).images[0]

image.save("schnell_output.png")
print("在 RTX 4090 上约 3 秒内生成完成！")
```

### 高吞吐批量生成

```python
import torch
from diffusers import FluxPipeline
from pathlib import Path

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.bfloat16
)
pipe.to("cuda")  # 保持在 GPU 上以提速，不要使用 cpu_offload

output_dir = Path("schnell_outputs")
output_dir.mkdir(exist_ok=True)

prompts = [
    "一座宁静的山间湖泊在黎明时分，雾气缭绕",
    "夜晚繁忙的东京街头市场，霓虹反射",
    "一张带露珠的蜘蛛网微距照片",
    "一座古老的图书馆，漂浮的书籍和魔法光芒",
    "一座未来感的水下城市，带有生物荧光海洋生物",
]

# 批量生成
for i, prompt in enumerate(prompts):
    image = pipe(
        prompt=prompt,
        height=1024,
        width=1024,
        num_inference_steps=4,
        guidance_scale=0.0,
        generator=torch.Generator(device="cuda").manual_seed(i),
    ).images[0]
    image.save(output_dir / f"image_{i:04d}.png")
    print(f"已生成 {i+1}/{len(prompts)}：{prompt[:50]}...")
```

### schnell 的多种宽高比

```python
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()

# FLUX 支持灵活的宽高比
resolutions = {
    "square":    (1024, 1024),
    "portrait":  (768,  1360),
    "landscape": (1360, 768),
    "tall":      (576,  1792),
    "wide":      (1792, 576),
}

prompt = "一只威风凛凛的狼站在雪林中，专业野生动物摄影"

for name, (width, height) in resolutions.items():
    image = pipe(
        prompt=prompt,
        height=height,
        width=width,
        num_inference_steps=4,
        guidance_scale=0.0,
    ).images[0]
    image.save(f"schnell_{name}.png")
    print(f"已保存 {name}: {width}x{height}")
```

### 带内存优化的 schnell

```python
import torch
from diffusers import FluxPipeline

# 适用于 12GB 显存（RTX 3060/3080）
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.float16  # fp16 在较旧 GPU 上可节省内存
)
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()
pipe.enable_vae_tiling()

image = pipe(
    prompt="秋日森林中的舒适小木屋，窗外透出温暖的光线",
    height=768,
    width=768,
    num_inference_steps=4,
    guidance_scale=0.0,
).images[0]
image.save("schnell_low_vram.png")
```

### 性能基准（schnell）

| GPU           | VRAM | 每张图时间（1024px） | 每小时图像数 |
| ------------- | ---- | ------------- | ------ |
| RTX 3060 12GB | 12GB | \~8 秒         | \~450  |
| RTX 3090 24GB | 24GB | \~4 秒         | \~900  |
| RTX 4090 24GB | 24GB | \~3 秒         | \~1200 |
| A100 40GB     | 40GB | 约 2 秒         | \~1800 |

### 何时使用 schnell 与 dev

**在以下情况下使用 FLUX.1-schnell：**

* 快速原型设计 / 测试提示词
* 大批量生成
* 商业项目（Apache 2.0）
* GPU 预算有限
* 实时或接近实时的应用

**在以下情况下使用 FLUX.1-dev：**

* 以最高图像质量为优先
* 精细细节和复杂场景
* 研究 / 艺术工作
* 与 LoRA/ControlNet 结合使用（dev 的响应通常更好）

***

## 下一步

* [ComfyUI](/guides/guides_v2-zh/tu-xiang-sheng-cheng/comfyui.md) - FLUX 的最佳界面
* [Fooocus](/guides/guides_v2-zh/tu-xiang-sheng-cheng/fooocus-simple-sd.md) - 简单的替代方案
* [ControlNet](/guides/guides_v2-zh/tu-xiang-chu-li/controlnet-advanced.md) - 引导式生成
* [Kohya Training](/guides/guides_v2-zh/xun-lian/kohya-training.md) - 训练 FLUX LoRA


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-zh/tu-xiang-sheng-cheng/flux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
