Comfy UI Workflow

Use Cinna's SDK to execute ComfyUI workflows such as text-to-video generation and image upscaling, all coordinated through decentralized GPUs and verified on Solana.


Introduction

ComfyUI is an open-source visual interface that supports advanced generative tasks like text-to-image, image-to-image, and text-to-video. Cinna’s SDK simplifies interaction with ComfyUI by abstracting away node graph logic and exposing clean functions in a Node.js environment. This lets developers run visual workflows on distributed GPU infrastructure with minimal setup.


Supported Workflows

The following ComfyUI workflows are currently supported through the Cinna SDK:

  • Text to Video Generation Convert descriptive prompts into short video clips using diffusion-based models

  • Image Upscaling Enhance low-resolution images while preserving detail and visual clarity


Core Concepts

Each ComfyUI process is represented as a WorkflowTask. The SDK includes a base class that handles all shared functionality. Individual workflows extend this base and define specific input requirements.


Before You Begin

  1. Obtain your Cinna API key

  2. Add the following to your .env file:

envCopy codeCINNA_API_KEY=your_api_key
CINNA_WORKFLOW_URL=https://sequencer-v2.cinna.ai

WorkflowTask Structure

Each task uses a JSON definition of the ComfyUI node graph. You can define unique workflows by subclassing the base class.

Base Class

Task Option Type

Task Result Type


Available Functions

Execute a workflow Submits the workflow task for execution.

Returns the task ID.


Query a task result Checks the status or output of a submitted task.

Returns the current state and result.


Execute and wait for result Runs the task and polls until the result is ready.


Cancel a task Stops a running task before completion.

Last updated