HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

ComfyUI-R1: Exploring Reasoning Models for Workflow Generation

Zhenran Xu Yiyu Wang Xue Yang Longyue Wang Weihua Luo Kaifu Zhang Baotian Hu Min Zhang

ComfyUI-R1: Exploring Reasoning Models for Workflow Generation

Abstract

AI-generated content has evolved from monolithic models to modular workflows,particularly on platforms like ComfyUI, enabling customization in creativepipelines. However, crafting effective workflows requires great expertise toorchestrate numerous specialized components, presenting a steep learning curvefor users. To address this challenge, we introduce ComfyUI-R1, the first largereasoning model for automated workflow generation. Starting with our curateddataset of 4K workflows, we construct long chain-of-thought (CoT) reasoningdata, including node selection, workflow planning, and code-level workflowrepresentation. ComfyUI-R1 is trained through a two-stage framework: (1) CoTfine-tuning for cold start, adapting models to the ComfyUI domain; (2)reinforcement learning for incentivizing reasoning capability, guided by afine-grained rule-metric hybrid reward, ensuring format validity, structuralintegrity, and node-level fidelity. Experiments show that our 7B-parametermodel achieves a 97\% format validity rate, along with high pass rate,node-level and graph-level F1 scores, significantly surpassing priorstate-of-the-art methods that employ leading closed-source models such asGPT-4o and Claude series. Further analysis highlights the critical role of thereasoning process and the advantage of transforming workflows into code.Qualitative comparison reveals our strength in synthesizing intricate workflowswith diverse nodes, underscoring the potential of long CoT reasoning in AI artcreation.

Code Repositories

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp