ComfyUI-R1: Exploring Reasoning Models for Workflow Generation
AI-generated content has evolved from monolithic models to modular workflows,
particularly on platforms like ComfyUI, enabling customization in creative
pipelines. However, crafting effective workflows requires great expertise to
orchestrate numerous specialized components, presenting a steep learning curve
for users. To address this challenge, we introduce ComfyUI-R1, the first large
reasoning model for automated workflow generation. Starting with our curated
dataset of 4K workflows, we construct long chain-of-thought (CoT) reasoning
data, including node selection, workflow planning, and code-level workflow
representation. ComfyUI-R1 is trained through a two-stage framework: (1) CoT
fine-tuning for cold start, adapting models to the ComfyUI domain; (2)
reinforcement learning for incentivizing reasoning capability, guided by a
fine-grained rule-metric hybrid reward, ensuring format validity, structural
integrity, and node-level fidelity. Experiments show that our 7B-parameter
model achieves a 97\% format validity rate, along with high pass rate,
node-level and graph-level F1 scores, significantly surpassing prior
state-of-the-art methods that employ leading closed-source models such as
GPT-4o and Claude series. Further analysis highlights the critical role of the
reasoning process and the advantage of transforming workflows into code.
Qualitative comparison reveals our strength in synthesizing intricate workflows
with diverse nodes, underscoring the potential of long CoT reasoning in AI art
creation.
684a33989b38e1e5a33a6804
Zhenran Xu
claimed_verified
2025-06-12T12:42:13.515Z
639c379cdb7c5f35004066cb
/avatars/3e435506ee85aa7d2d0ec2174a07462f.svg
Zhenran Xu
user
imryanxu
684a33989b38e1e5a33a6805
Yiyu Wang
claimed_verified
2025-06-12T12:42:11.706Z
6309995efa440d8b5bd5ddc2
/avatars/e7350783a8edc5660afd5173818f02f2.svg
Yiyu Wang
user
Curya
684a33989b38e1e5a33a6806
Xue Yang
684a33989b38e1e5a33a6807
Longyue Wang
684a33989b38e1e5a33a6808
Weihua Luo
684a33989b38e1e5a33a6809
Kaifu Zhang
684a33989b38e1e5a33a680a
Baotian Hu
684a33989b38e1e5a33a680b
Min Zhang
ComfyUI-R1: Exploring Reasoning Models for Workflow Generation
AI-generated content has evolved from monolithic models to modular workflows,
particularly on platforms like ComfyUI, enabling customization in creative
pipelines. However, crafting effective workflows requires great expertise to
orchestrate numerous specialized components, presenting a steep learning curve
for users. To address this challenge, we introduce ComfyUI-R1, the first large
reasoning model for automated workflow generation. Starting with our curated
dataset of 4K workflows, we construct long chain-of-thought (CoT) reasoning
data, including node selection, workflow planning, and code-level workflow
representation. ComfyUI-R1 is trained through a two-stage framework: (1) CoT
fine-tuning for cold start, adapting models to the ComfyUI domain; (2)
reinforcement learning for incentivizing reasoning capability, guided by a
fine-grained rule-metric hybrid reward, ensuring format validity, structural
integrity, and node-level fidelity. Experiments show that our 7B-parameter
model achieves a 97\% format validity rate, along with high pass rate,
node-level and graph-level F1 scores, significantly surpassing prior
state-of-the-art methods that employ leading closed-source models such as
GPT-4o and Claude series. Further analysis highlights the critical role of the
reasoning process and the advantage of transforming workflows into code.
Qualitative comparison reveals our strength in synthesizing intricate workflows
with diverse nodes, underscoring the potential of long CoT reasoning in AI art
creation.
ComfyUI-R1, a large reasoning model for automated workflow generation, demonstrates superior performance in creating AI art workflows through long chain-of-thought reasoning and reinforcement learning.
modular workflows ComfyUI large reasoning model automated workflow generation chain-of-thought (CoT) reasoning node selection workflow planning code-level workflow representation CoT fine-tuning reinforcement learning fine-grained rule-metric hybrid reward format validity structural integrity node-level fidelity GPT-4o Claude series pass rate node-level F1 scores graph-level F1 scores intricate workflows diverse nodes qualitative comparison AI art creation