What you’ll learn
In this guide, you’ll learn how to use ComfyUI-to-API to transform your ComfyUI workflows into Serverless workers. You’ll upload a workflow file exported from ComfyUI, review the AI-powered analysis, generate a Dockerfile with all necessary dependencies, create a GitHub repository, and deploy it to Runpod Serverless using GitHub integration.Requirements
Before getting started, make sure you have:- A ComfyUI workflow file exported via Comfy → File → Export (the full workflow export, not the API export).
- A GitHub account for repository creation.
- A Runpod account for Serverless deployment.
- Basic familiarity with ComfyUI workflows and custom nodes.
Make sure to export your workflow using Comfy → File → Export (not the API
export). The tool needs the complete workflow information to properly analyze
your setup.
Step 1: Sign in with GitHub
Visit comfy.getrunpod.io to access ComfyUI-to-API. The tool requires you to sign in with your GitHub account so it can create a repository on your behalf in a later step. Click Sign in with GitHub and authorize the application. Once authenticated, you’ll be able to proceed with uploading your workflow.Step 2: Upload your workflow
Once you’ve accessed the tool, the first step is to upload your ComfyUI workflow file. In ComfyUI, export your workflow using Comfy → File → Export (not the API export). This exports the complete workflow information needed for analysis. Then click the upload area or drag and drop yourworkflow.json
file into the tool.
After uploading, you’ll see a confirmation showing the filename and basic workflow information. The tool performs a quick validation to ensure your file is a valid ComfyUI workflow before proceeding to analysis.
Step 3: Analyze your workflow
Click the Analyze button to run the custom Comfy Agent. You’ll see progress information as the tool works through your workflow. The analysis process detects custom nodes in your workflow, locates required models and their download URLs, resolves dependencies between nodes, and determines installation methods for each component. This typically takes 30-60 seconds depending on the complexity of your workflow. The analysis results are displayed in expandable sections showing custom nodes found, models identified, and any potential issues or recommendations.Step 4: Review the generated Dockerfile
After analysis completes, the tool generates a Dockerfile based on your workflow. Review the Dockerfile to see what will be installed. The generated Dockerfile uses the runpod-workers/worker-comfyui base image, which provides a clean ComfyUI installation without any models. The Dockerfile then adds installation commands for all your custom nodes, model download instructions with URLs, proper Python dependencies, and optimized caching layers for faster builds. You can review and tweak the Dockerfile if needed, or skip ahead to the next step to create your GitHub repository.Review the Dockerfile carefully to ensure all your custom nodes and models are
included. The AI is quite thorough, but you may want to add additional
customizations for your specific use case.
Step 5: Create your repository
Now you can create a GitHub repository with all the necessary files for Serverless deployment. Since you authenticated with GitHub in step 1, the tool can create the repository on your behalf. Enter your desired repository name and optionally provide a description. The tool creates a repository containing your Dockerfile and a README with setup and deployment instructions. Click Create GitHub repo and watch the real-time progress as the tool creates your repository. Once complete, you’ll see a success message with a direct link to your new GitHub repository.Step 6: Deploy to Runpod Serverless
With your GitHub repository created, you’re ready to deploy to Runpod Serverless using the GitHub integration. This is where Runpod builds your Docker image from the Dockerfile and deploys it to an endpoint. Navigate to create a new endpoint in the Runpod console. Under “Import Git Repository”, select your newly created repository from the dropdown menu. You’ll need to connect your GitHub account to Runpod once if you haven’t already. Configure your deployment settings including which branch to deploy from (typicallymain
), the path to your Dockerfile (typically in the root), and your GPU requirements based on your workflow’s needs.
For detailed instructions on deploying from GitHub, including how to authorize
Runpod with your GitHub account and configure deployment options, see Deploy
workers from GitHub.
Understanding the repository files
The generated repository includes the essential files needed to build your Serverless worker. TheDockerfile
contains all the instructions to build your worker image. It starts from the runpod-workers/worker-comfyui base image, which provides a clean ComfyUI installation along with all the handler code needed to run as a Serverless endpoint. Your Dockerfile then adds your custom nodes and downloads your required models. When you deploy via GitHub integration, Runpod uses this Dockerfile to build your Docker image.
The README.md
provides documentation about your workflow and deployment instructions.
You can customize the Dockerfile after creation. For example, you might want
to add additional dependencies, adjust model download locations, or optimize
the build process.
Updating your deployed worker
When you make changes to your repository, such as updating the Dockerfile to add new models or custom nodes, Runpod automatically detects these changes. The GitHub integration monitors yourmain
branch for changes. When you push commits to main
, Runpod automatically rebuilds the Docker image and updates your endpoint with the new version. You can monitor the rebuild progress in the “Builds” tab of your endpoint detail page.
For more details on managing deployments and monitoring builds, see Deploy workers from GitHub.
Troubleshooting
Wrong workflow export format
Wrong workflow export format
Problem: The tool shows an error or doesn’t detect my workflow properly.
Solution:
- Make sure you exported using Comfy → File → Export (not the API export).
- The file should be named
workflow.json
and contain the complete workflow structure.
- If you used the API export, go back to ComfyUI and use File → Export instead.
Dockerfile missing dependencies
Dockerfile missing dependencies
Problem: The generated Dockerfile doesn’t include all your custom nodes
or models.Solution:
- Review the analysis results to see what was detected.
- Some very new or obscure custom nodes may not be found automatically.
- You can manually edit the Dockerfile in your GitHub repository to add missing components.
- Check the ComfyUI Registry to find installation instructions for missing nodes.