Skip to content

feat: comprehensive ComfyUI integration for all media types#137

Open
pannous wants to merge 3 commits into
jbilcke-hf:mainfrom
pannous:feat/comprehensive-comfyui-integration
Open

feat: comprehensive ComfyUI integration for all media types#137
pannous wants to merge 3 commits into
jbilcke-hf:mainfrom
pannous:feat/comprehensive-comfyui-integration

Conversation

@pannous
Copy link
Copy Markdown

@pannous pannous commented Mar 15, 2026

Summary

Fixes #5

This PR extends ComfyUI support to all media types (image, video, voice, sound, music) and fixes the broken ComfyICU and ComfyDeploy provider stubs.

Changes

ComfyUI Local Provider (comfyui/index.ts)

  • Extended to support voice, sound, and music segment categories alongside existing image and video support
  • Audio categories use prompt-based inputs without width/height parameters
  • Audio output handling supports audio, files, and images output formats

ComfyICU Provider (comfy-comfyicu/index.ts)

  • Implemented proper submit/poll workflow execution flow (was a stub that always threw errors)
  • Added support for all media categories (image, video, voice, sound, music)
  • Prompt injection into workflow data before submission
  • Configurable polling with timeout protection

ComfyDeploy Provider (comfy-comfydeploy/index.ts)

  • Implemented proper submit/poll workflow execution flow (was a stub that always threw errors)
  • Added support for all media categories
  • Input overrides with prompt injection
  • Flexible output extraction handling multiple response formats

Settings & Types

  • Added ClapWorkflow types for voice/sound/music (comfyClapWorkflowForVoice/Sound/Music)
  • Added default workflow definitions for voice, sound, and music
  • Added setters in the settings store matching existing image/video pattern
  • Extended convertComfyUiWorkflowApiToClapWorkflow with voice/sound/music metadata
  • Extended getMainInputIdsByClapWorkflowCategory with audio-specific input IDs

UI Improvements

  • Upgraded voice/sound/music settings from raw text areas to FormComfyUIWorkflowSettings component (consistent with image/video)
  • Added ComfyUI connection status indicator in provider settings (polls /system_stats)
  • Added missing ComfyDeploy API key field to provider settings

Test plan

  • All existing ComfyUI unit tests pass (11/11 in tests.spec.ts)
  • ESLint passes with no warnings or errors
  • All workspace packages build successfully (clap, timeline, clapper-services)
  • Manual testing with local ComfyUI instance for image/video generation
  • Manual testing with ComfyUI audio workflows (voice/sound/music)
  • Manual testing with ComfyICU cloud provider
  • Manual testing with ComfyDeploy cloud provider

Fixes jbilcke-hf#5

- Extended ComfyUI local provider to support voice, sound, and music
  generation (previously only image and video were supported)
- Fixed ComfyICU provider with proper submit/poll flow and multi-category
  support (was a broken stub that always threw errors)
- Fixed ComfyDeploy provider with submit/poll flow, prompt injection,
  and multi-category support (was a broken stub)
- Added ClapWorkflow types and default workflows for voice/sound/music
- Added setters for comfyClapWorkflowForVoice/Sound/Music in settings store
- Upgraded voice/sound/music settings UI from raw text areas to use
  FormComfyUIWorkflowSettings component (consistent with image/video)
- Added ComfyUI connection status indicator in provider settings
- Added ComfyDeploy API key field to provider settings UI
- Extended convertComfyUiWorkflowApiToClapWorkflow for all audio categories
- Extended getMainInputIdsByClapWorkflowCategory with audio-specific inputs
Copilot AI review requested due to automatic review settings March 15, 2026 13:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the ComfyUI ecosystem integrations so Clapper can run ComfyUI workflows for all segment media types (image, video, voice, sound, music), and replaces the previously non-functional Comfy.icu and ComfyDeploy provider stubs with real submit/poll execution flows.

Changes:

  • Adds default ComfyUI ClapWorkflow settings + Zustand setters for voice/sound/music, and updates the settings UI to use the same workflow editor component as image/video.
  • Extends the local ComfyUI resolver to route workflows by segment category and handle audio outputs.
  • Implements Comfy.icu and ComfyDeploy workflow execution via run submission + polling, with prompt injection and output URL extraction.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/clapper-services/src/settings.ts Extends settings types with ComfyUI clap-workflow slots for voice/sound/music.
packages/app/src/services/settings/workflows/voice.ts Adds default ComfyUI clap workflow definition for voice.
packages/app/src/services/settings/workflows/sound.ts Adds default ComfyUI clap workflow definition for sound.
packages/app/src/services/settings/workflows/music.ts Adds default ComfyUI clap workflow definition for music.
packages/app/src/services/settings/getDefaultSettingsState.ts Wires new default clap workflows into the default settings state.
packages/app/src/services/settings/useSettings.ts Adds setters and persistence/merge wiring for new ComfyUI clap workflows.
packages/app/src/components/settings/voice.tsx Switches voice settings from raw JSON textarea to FormComfyUIWorkflowSettings.
packages/app/src/components/settings/sound.tsx Switches sound settings from raw JSON textarea to FormComfyUIWorkflowSettings.
packages/app/src/components/settings/music.tsx Switches music settings from raw JSON textarea to FormComfyUIWorkflowSettings.
packages/app/src/components/settings/provider.tsx Adds ComfyUI connection status indicator and ComfyDeploy API key field.
packages/app/src/components/comfyui/ComfyUIConnectionStatus.tsx New UI component that polls /system_stats to show local ComfyUI connectivity.
packages/app/src/app/api/resolve/providers/comfyui/index.ts Extends local ComfyUI resolver routing + inputs/outputs to support audio categories.
packages/app/src/app/api/resolve/providers/comfyui/getMainInputIdsByClapWorkflowCategory.ts Adds voice/sound/music main input IDs (prompt/seed/output).
packages/app/src/app/api/resolve/providers/comfyui/convertComfyUiWorkflowApiToClapWorkflow.ts Extends ComfyUI-workflow-to-clap conversion metadata for voice/sound/music.
packages/app/src/app/api/resolve/providers/comfy-comfyicu/index.ts Implements Comfy.icu workflow run submission + polling and output URL extraction.
packages/app/src/app/api/resolve/providers/comfy-comfydeploy/index.ts Implements ComfyDeploy workflow run submission + polling and output URL extraction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread packages/app/src/app/api/resolve/providers/comfyui/index.ts Outdated
Comment thread packages/app/src/app/api/resolve/providers/comfy-comfydeploy/index.ts Outdated
Comment thread packages/app/src/app/api/resolve/providers/comfyui/index.ts Outdated
Comment thread packages/app/src/app/api/resolve/providers/comfy-comfyicu/index.ts Outdated
Comment thread packages/app/src/app/api/resolve/providers/comfy-comfyicu/index.ts Outdated
Comment thread packages/app/src/app/api/resolve/providers/comfy-comfyicu/index.ts
Comment thread packages/app/src/app/api/resolve/providers/comfyui/index.ts Outdated
pannous and others added 2 commits March 16, 2026 09:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The inputValues union type (string | number | boolean | ... | ClapInputValueObject)
requires proper narrowing before accessing .id. Use object type guard instead of
optional chaining to satisfy TypeScript and prevent potential runtime errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve ComfyUI integration

2 participants