Seamlessly integrate ComfyUI AI workflows into your Drupal site with dynamic forms, field mapping, and Layout Builder support.

Alpha Release Notice

This module is currently in alpha development and has only been tested on limited workflows. While functional, it may have bugs and incomplete features. Use with caution in production environments and please report any issues you encounter.

What is ComfyUI Integration?

This module bridges the gap between Drupal and ComfyUI, the powerful node-based AI image generation interface. Create interactive workflow forms that allow your users to generate AI content directly from your Drupal site. Transform your Drupal site into an AI content generation platform with intuitive workflows and professional output management.

Key Features

  • Workflow Entities - Create reusable ComfyUI workflows as Drupal entities
  • Dynamic Field Mapping - Map Drupal fields to ComfyUI workflow parameters through configurable node mappings
  • Layout Builder Integration - Build custom workflow interfaces with drag-and-drop blocks
  • Multiple Display Modes - Form, API, headless, and batch processing modes
  • Smart Seed Management - Random Seed Widget with Fixed/Random/Use Last modes for reproducible AI generation
  • Output Handling - Automatic processing of images, videos, and text outputs
  • Field Validation - Ensure data integrity with configurable validation rules
  • Queue Processing - Handle long-running workflows with Drupal's queue system
  • Image Proxy - Serve ComfyUI-generated images through Drupal
  • Workflow Form Builder - Admin interface for creating dynamic user-facing forms

Layout Builder Blocks

The module provides two essential Layout Builder blocks for creating dynamic workflow interfaces:

  • ComfyUI Dynamic Field Block - Add individual input fields (prompts, seeds, parameters) that automatically map to your workflow
  • ComfyUI Form Container Block - Provides the execution button and results display area for your workflow

Simply drag these blocks into your Layout Builder pages to create custom AI generation interfaces without any coding.

How It Works

  1. Configure Mappings - Map ComfyUI workflow parameters to user-friendly field names
  2. Build Forms - Use the admin interface to create dynamic forms for end users
  3. Generate Content - Users interact with forms to trigger AI content generation
  4. Display Results - Generated content is automatically processed and displayed through Drupal

Perfect For

  • Content creators building AI-powered websites
  • Developers integrating AI workflows into client projects
  • Artists and designers creating AI content management systems
  • Agencies offering AI content generation services
  • Site builders who want to provide AI tools to their users without technical complexity

Requirements

  • Drupal 10+
  • Access to a ComfyUI server instance (local installation or cloud hosting)
  • Layout Builder (for dynamic forms)
  • PHP 8.1+

Getting Started

  1. Download and enable the module
  2. Configure your ComfyUI server connection at /admin/structure/comfyui-workflow/settings
  3. Create your first workflow entity at /admin/structure/comfyui-workflow
  4. Upload your ComfyUI workflow JSON and configure field mappings
  5. Use Layout Builder to add ComfyUI Dynamic Field Blocks and ComfyUI Form Container Block to create your user interface
  6. Publish and let users generate AI content!

Quick Example

Create a simple text-to-image generator in minutes:

  1. Add your ComfyUI URL in the ComfyUI Integration Settings
  2. Upload a Stable Diffusion workflow JSON and its API JSON
  3. Edit the new workflow entry and map the "positive prompt" field to a user-friendly text input
  4. Map the "seed" field to a number input
  5. Change the "seed" field's form widget to use the Random Seed Generator
  6. Enable Layout Builder for all ComfyUI Workflows
  7. Click the Manage Layouts action on the Workflow entry
  8. Add Dynamic Field Blocks for prompt and seed inputs to your page
  9. Add the Form Container Block for execution and results
  10. Users can now generate images directly from your Drupal site!

Support & Development

For issues, feature requests, and documentation, please submit issues in the queue.

Looking for Sponsorship: I'm actively seeking sponsorship to support development of this module. If you're interested in supporting this project or have specific feature needs, please reach out to discuss partnership opportunities.

Development Roadmap

The following features are planned for future releases:

  • Allow configuring Workflow Default Values - This would allow setting ComfyUI node default values for the workflow whether exposed in the form or not
  • Optionally Save Results Locally as File entities or File URLs - Make results configurable to always be saved locally either as a result copy or a remote URL.
  • Enhanced Output Rendering - Better support for more types of results and node outputs
  • Make Workflows Visually "Chain-able" - Using something like BPMN or n8n (perhaps via the Modeler API?) combining workflows and passing results could allow for AI Agentic ComfyUI workflows.
  • API Submodule - Complete API integration with API key generation and OAuth2 authentication
  • Multiple ComfyUI Endpoint Support - Allow queuing and processing over multiple endpoints with smart queuing across a server farm
  • Add External API support with Providers for Automatic Machine Usage - Using providers such as Runpod.io, Vast.ai, etc, it should be made possible to automatically start up machines when needed
  • Dynamic Field Workflows - Trigger workflows for field values on other content types, enabling:
    • LLM-powered translations
    • LLM field value replacements
    • Automated image creation
    • Full node creation workflows

Maintainers

This module is maintained by Alexander Renfert (Drupal User:NWOM) of Uber Diffusion AI. Contributions are welcome!

Short name
comfyui