# FLUX.1

{% hint style="info" %}
**更快的替代方案！** [**FLUX.2 Klein**](https://docs.clore.ai/guides/guides_v2-zh/tu-xiang-sheng-cheng/flux2-klein) 在 < 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

## 1024x1024

| A100           | 性能       | 质量 | 显存    | 许可         |
| -------------- | -------- | -- | ----- | ---------- |
| 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
```

## IC-Light 可作为 ComfyUI 节点使用：

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

所需节点：

1. **加载扩散模型（Load Diffusion Model）** → flux1-schnell.safetensors
2. **DualCLIPLoader** → clip\_l.safetensors + t5xxl\_fp16.safetensors
3. **CLIP 文本编码** → 你的提示（prompt）
4. **空的 SD3 潜在图像（Empty SD3 Latent Image）** → 设置尺寸
5. **KSampler** → steps: 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”,
1960 年代科幻美学，宇航员插画

# 复杂场景
一个舒适的图书馆内部，落地书架, 
壁炉旁的一把皮椅，窗外可见下雨,
温暖的灯光，写实摄影
```

## 内存优化

### 针对 12GB 显存（RTX 3060）

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-schnell",
    torch_dtype=torch.float16  # 在旧 GPU 上使用 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 显存

使用量化版本或在 ComfyUI 中使用 GGUF：

```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
```

## 性能比较

| A100           | 步数 | 时间（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 可能 OOM）
# - 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 平铺（tiling）
```

### RTX 4090 24GB（性能）

```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） |
| 按日费率          | \~$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(
    "触发词 一个美丽的风景",
    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 张带有标题的图像
# 编辑配置 YAML，然后：
python run.py config/flux_lora_train.yaml
```

### 推荐的 LoRA 来源

| 来源          | URL                   | 注意事项      |
| ----------- | --------------------- | --------- |
| CivitAI     | civitai.com           | 大型社区资源库   |
| HuggingFace | huggingface.co/models | 按 FLUX 过滤 |
| Replicate   | replicate.com         | 浏览已训练的模型  |

***

## FLUX 的 ControlNet

ControlNet 允许使用结构性输入（如 canny 边缘、深度图和姿态骨架）来引导 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 加载管线（pipeline）
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 的多 ControlNet（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 模型

| A100              | 仓库（Repo）                                    | 模型变体      |
| ----------------- | ------------------------------------------- | --------- |
| Canny（边缘）         | XLabs-AI/flux-controlnet-canny-diffusers    | 基于边缘的引导生成 |
| 深度                | XLabs-AI/flux-controlnet-depth-diffusers    | 基于深度的引导生成 |
| HED/软边（Soft Edge） | XLabs-AI/flux-controlnet-hed-diffusers      | 柔和的结构控制   |
| 姿势                | XLabs-AI/flux-controlnet-openpose-diffusers | 基于姿态的肖像生成 |

### ControlNet 使用技巧

* **conditioning\_scale 0.5–0.8** 最适合 FLUX（过高会丧失创造性）
* 使用 **1024×1024** 或其倍数以获得最佳质量
* 与 LoRA 结合以同时控制风格与结构
* 较低步数（20–25）通常足够使用 ControlNet 时

***

## 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        |
| 质量              | 很棒                    | 优秀         |
| 显存              | 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(
        os.makedirs("./variations", exist_ok=True)
        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 = {
    "方形":    (1024, 1024),
    "肖像":  (768,  1360),
    "横向": (1360, 768),
    "高长":      (576,  1792),
    "宽幅":      (1792, 576),
}

prompt = "一只雄伟的狼在雪林中，专业野生动物摄影"

for name, (width, height) in resolutions.items():
    image = pipe(
        os.makedirs("./variations", exist_ok=True)
        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           | 显存   | 每张图像时间（1024px） | 图像/小时  |
| ------------- | ---- | -------------- | ------ |
| RTX 3060 12GB | 12GB | ≈8 秒           | \~450  |
| RTX 3090 24GB | 24GB | \~4 秒          | \~900  |
| RTX 4090 24GB | 24GB | \~3 秒          | \~1200 |
| 按日费率          | 40GB | \~2 秒          | \~1800 |

### 何时使用 schnell 与 dev

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

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

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

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

***

## 使用以下方式支付

* [ComfyUI](https://docs.clore.ai/guides/guides_v2-zh/tu-xiang-sheng-cheng/comfyui) - 最佳的 FLUX 界面
* [- 将重光图像转换为 3D](https://docs.clore.ai/guides/guides_v2-zh/tu-xiang-sheng-cheng/fooocus-simple-sd) - 简单的替代方案
* [ControlNet](https://docs.clore.ai/guides/guides_v2-zh/tu-xiang-chu-li/controlnet-advanced) - 引导式生成
* [Kohya 训练](https://docs.clore.ai/guides/guides_v2-zh/xun-lian/kohya-training) - 训练 FLUX LoRAs
