Skip to content

Commit 76784ce

Browse files
authored
Add USO docs (#400)
1 parent b7c9123 commit 76784ce

File tree

6 files changed

+217
-2
lines changed

6 files changed

+217
-2
lines changed

docs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
"tutorials/flux/flux1-krea-dev",
120120
"tutorials/flux/flux-1-kontext-dev",
121121
"tutorials/flux/flux-1-text-to-image",
122+
"tutorials/flux/flux-1-uso",
122123
"tutorials/flux/flux-1-fill-dev",
123124
"tutorials/flux/flux-1-controlnet"
124125
]
@@ -676,6 +677,7 @@
676677
"zh-CN/tutorials/flux/flux1-krea-dev",
677678
"zh-CN/tutorials/flux/flux-1-kontext-dev",
678679
"zh-CN/tutorials/flux/flux-1-text-to-image",
680+
"zh-CN/tutorials/flux/flux-1-uso",
679681
"zh-CN/tutorials/flux/flux-1-fill-dev",
680682
"zh-CN/tutorials/flux/flux-1-controlnet"
681683
]
1.07 MB
Loading
738 KB
Loading

snippets/tutorials/update-reminder.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Workflows in this guide can be found in the [Workflow Templates](/interface/feat
77
If you can't find them in the template, your ComfyUI may be outdated.(Desktop version's update will delay sometime)
88

99
If nodes are missing when loading a workflow, possible reasons:
10-
1. Not using the latest ComfyUI version(Nightly version)
11-
2. Using Stable or Desktop version (Latest changes may not be included)
10+
1. You are not using the latest ComfyUI version(Nightly version)
11+
2. You are using Stable or Desktop version (Latest changes may not be included)
1212
3. Some nodes failed to import at startup
1313
</Tip>

tutorials/flux/flux-1-uso.mdx

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: "ByteDance USO ComfyUI Native Workflow example"
3+
description: "Unified Style and Subject-Driven Generation with ByteDance's USO model"
4+
sidebarTitle: "ByteDance USO"
5+
---
6+
7+
import UpdateReminder from '/snippets/tutorials/update-reminder.mdx'
8+
9+
**USO (Unified Style-Subject Optimized)** is a model developed by ByteDance's UXO Team that unifies style-driven and subject-driven generation tasks.
10+
Built on FLUX.1-dev architecture, the model achieves both style similarity and subject consistency through disentangled learning and style reward learning (SRL).
11+
12+
USO supports three main approaches:
13+
- **Subject-Driven**: Place subjects into new scenes while maintaining identity consistency
14+
- **Style-Driven**: Apply artistic styles to new content based on reference images
15+
- **Combined**: Use both subject and style references simultaneously
16+
17+
**Related Links**
18+
- [Project Page](https://bytedance.github.io/USO/)
19+
- [GitHub](https://github.com/bytedance/USO)
20+
- [Model Weights](https://huggingface.co/bytedance-research/USO)
21+
22+
## ByteDance USO ComfyUI Native Workflow
23+
24+
<UpdateReminder/>
25+
26+
### 1. Workflow and input
27+
28+
Download the image below and drag it into ComfyUI to load the corresponding workflow.
29+
30+
![Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/flux/bytedance-uso/bytedance-uso.png)
31+
32+
<a
33+
className="prose"
34+
target='_blank'
35+
href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/templates/flux1_dev_uso_reference_image_gen.json"
36+
style={{ display: 'inline-block', backgroundColor: '#0078D6', color: '#ffffff', padding: '10px 20px', borderRadius: '8px', borderColor: "transparent", textDecoration: 'none', fontWeight: 'bold'}}
37+
>
38+
<p className="prose" style={{ margin: 0, fontSize: "0.8rem" }}>Download JSON Workflow</p>
39+
</a>
40+
41+
Use the image below as an input image.
42+
43+
![input](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/flux/bytedance-uso/input.png)
44+
45+
### 2. Model links
46+
47+
48+
**checkpoints**
49+
50+
- [flux1-dev-fp8.safetensors](https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors)
51+
52+
**loras**
53+
54+
- [uso-flux1-dit-lora-v1.safetensors](https://huggingface.co/Comfy-Org/USO_1.0_Repackaged/resolve/main/split_files/loras/uso-flux1-dit-lora-v1.safetensors)
55+
56+
**model_patches**
57+
58+
- [uso-flux1-projector-v1.safetensors](https://huggingface.co/Comfy-Org/USO_1.0_Repackaged/resolve/main/split_files/model_patches/uso-flux1-projector-v1.safetensors)
59+
60+
**clip_visions**
61+
- [sigclip_vision_patch14_384.safetensors](https://huggingface.co/Comfy-Org/sigclip_vision_384/resolve/main/sigclip_vision_patch14_384.safetensors)
62+
63+
Please download all models and place them in the following directories:
64+
65+
```
66+
📂 ComfyUI/
67+
├── 📂 models/
68+
│ ├── 📂 checkpoints/
69+
│ │ └── flux1-dev-fp8.safetensors
70+
│ ├── 📂 loras/
71+
│ │ └── uso-flux1-dit-lora-v1.safetensors
72+
│ ├── 📂 model_patches/
73+
│ │ └── uso-flux1-projector-v1.safetensors
74+
│ ├── 📂 clip_visions/
75+
│ │ └── sigclip_vision_patch14_384.safetensors
76+
```
77+
78+
79+
### 3. Workflow instructions
80+
81+
![Workflow instructions](/images/tutorial/flux/flux1_uso_reference_image_gen.jpg)
82+
83+
1. Load models:
84+
- 1.1 Ensure the `Load Checkpoint` node has `flux1-dev-fp8.safetensors` loaded
85+
- 1.2 Ensure the `LoraLoaderModelOnly` node has `dit_lora.safetensors` loaded
86+
- 1.3 Ensure the `ModelPatchLoader` node has `projector.safetensors` loaded
87+
- 1.4 Ensure the `Load CLIP Vision` node has `sigclip_vision_patch14_384.safetensors` loaded
88+
2. Click `Upload` to upload the input image we provided
89+
3. In the example, we only use the `content reference` image input. If you want to use the `style reference` image input, you can use `Ctrl-B` to bypass the marked node group.
90+
4. Write your prompt or keep default
91+
5. The EasyCache node is for inference acceleration, but it will also sacrifice some quality and details. You can bypass it (Ctrl+B) if you don't need to use it.
92+
6. Click the `Run` button, or use the shortcut `Ctrl(Cmd) + Enter` to run the workflow
93+
94+
### 4. Additional Notes
95+
96+
1. Style reference only:
97+
98+
We also provide a workflow that only uses style reference in the same workflow we provided
99+
100+
![Workflow](/images/tutorial/flux/flux1_uso_reference_image_gen_style_reference_only.jpg)
101+
The only different is we replaced the `content reference` node and only use an `Empty Latent Image` node.
102+
103+
2. You can also bypass whole `Style Reference` group and use the workflow as a text to image workflow, which means this workflow has 4 variations
104+
- Only use content (subject) reference
105+
- Only use style reference
106+
- Mixed content and style reference
107+
- As a text to image workflow
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: "字节跳动 USO ComfyUI 原生工作流示例"
3+
description: "使用字节跳动 USO 模型实现统一风格和主体驱动生成"
4+
sidebarTitle: "字节跳动 USO"
5+
---
6+
7+
import UpdateReminder from '/snippets/zh/tutorials/update-reminder.mdx'
8+
9+
**USO (Unified Style-Subject Optimized)** 是字节跳动 UXO 团队开发的模型,统一了风格驱动和主体驱动生成任务。
10+
基于 FLUX.1-dev 架构构建,该模型通过解耦学习和风格奖励学习 (SRL) 实现了风格相似性和主体一致性。
11+
12+
USO 支持三种主要方法:
13+
14+
- **主体驱动**:将主体放置到新场景中,同时保持身份一致性
15+
- **风格驱动**:基于参考图像将艺术风格应用于新内容
16+
- **组合模式**:同时使用主体和风格参考
17+
18+
**相关链接**
19+
- [项目主页](https://bytedance.github.io/USO/)
20+
- [GitHub](https://github.com/bytedance/USO)
21+
- [模型权重](https://huggingface.co/bytedance-research/USO)
22+
23+
## 字节跳动 USO ComfyUI 原生工作流
24+
25+
<UpdateReminder/>
26+
27+
### 1. 工作流和输入
28+
29+
下载下方图像并拖拽到 ComfyUI 中以加载对应的工作流。
30+
31+
![工作流](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/flux/bytedance-uso/bytedance-uso.png)
32+
33+
<a
34+
className="prose"
35+
target='_blank'
36+
href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/templates/flux1_dev_uso_reference_image_gen.json"
37+
style={{ display: 'inline-block', backgroundColor: '#0078D6', color: '#ffffff', padding: '10px 20px', borderRadius: '8px', borderColor: "transparent", textDecoration: 'none', fontWeight: 'bold'}}
38+
>
39+
<p className="prose" style={{ margin: 0, fontSize: "0.8rem" }}>下载 JSON 工作流</p>
40+
</a>
41+
42+
使用下面的图片作为输入
43+
44+
![输入图像](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/flux/bytedance-uso/input.png)
45+
46+
### 2. 模型链接
47+
48+
**checkpoints**
49+
50+
- [flux1-dev-fp8.safetensors](https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors)
51+
52+
**loras**
53+
54+
- [uso-flux1-dit-lora-v1.safetensors](https://huggingface.co/Comfy-Org/USO_1.0_Repackaged/resolve/main/split_files/loras/uso-flux1-dit-lora-v1.safetensors)
55+
56+
**model_patches**
57+
58+
- [uso-flux1-projector-v1.safetensors](https://huggingface.co/Comfy-Org/USO_1.0_Repackaged/resolve/main/split_files/model_patches/uso-flux1-projector-v1.safetensors)
59+
60+
**clip_visions**
61+
- [sigclip_vision_patch14_384.safetensors](https://huggingface.co/Comfy-Org/sigclip_vision_384/resolve/main/sigclip_vision_patch14_384.safetensors)
62+
63+
请下载所有模型并将它们放置在以下目录中:
64+
65+
```
66+
📂 ComfyUI/
67+
├── 📂 models/
68+
│ ├── 📂 checkpoints/
69+
│ │ └── flux1-dev-fp8.safetensors
70+
│ ├── 📂 loras/
71+
│ │ └── uso-flux1-dit-lora-v1.safetensors
72+
│ ├── 📂 model_patches/
73+
│ │ └── uso-flux1-projector-v1.safetensors
74+
│ ├── 📂 clip_visions/
75+
│ │ └── sigclip_vision_patch14_384.safetensors
76+
```
77+
78+
79+
### 3. 工作流说明
80+
81+
![工作流说明](/images/tutorial/flux/flux1_uso_reference_image_gen.jpg)
82+
83+
1. 加载模型:
84+
- 1.1 确保 `Load Checkpoint` 节点已加载 `flux1-dev-fp8.safetensors`
85+
- 1.2 确保 `LoraLoaderModelOnly` 节点已加载 `dit_lora.safetensors`
86+
- 1.3 确保 `ModelPatchLoader` 节点已加载 `projector.safetensors`
87+
- 1.4 确保 `Load CLIP Vision` 节点已加载 `sigclip_vision_patch14_384.safetensors`
88+
2. 点击 `Upload` 上传我们提供的输入图像
89+
3. 在示例中,我们只使用 `content reference` 图像输入。如果你想使用 `style reference` 图像输入,可以使用 `Ctrl+B` 绕过标记的节点组。
90+
4. 编写你的提示词或保持默认设置
91+
5. EasyCache 节点用于推理加速,但也会牺牲一些质量和细节。如果不需要使用,可以用 `Ctrl+B` 绕过它。
92+
6. 点击 `Run` 按钮,或使用快捷键 `Ctrl(Cmd) + Enter` 运行工作流
93+
94+
### 4. 补充说明
95+
96+
1. 仅使用风格参考:
97+
98+
我们在同一个工作流中也提供了仅使用风格参考的版本
99+
![工作流](/images/tutorial/flux/flux1_uso_reference_image_gen_style_reference_only.jpg)
100+
唯一的区别是我们替换了 `content reference` 节点,仅使用 `Empty Latent Image` 节点来创建一个我们需要的图像大小
101+
102+
2. 你也可以 **绕过(Ctrl+B)** 整个 `Style Reference` 组,将工作流用作文本到图像的工作流,也就是这个文本存在 4 个变体
103+
- 仅使用内容(主体)参考
104+
- 仅使用风格参考
105+
- 混合内容及风格参考
106+
- 作为文生图工作流

0 commit comments

Comments
 (0)