Free GuidePaid Pack · $5

Turn Any Image into 3D with ComfyUI + RunPod Serverless (Full Tutorial)

Image-to-3D with ComfyUI + RunPod Serverless

Build an image-to-3D generation API using ComfyUI, RunPod Serverless, and persistent Network Storage. This guide covers preparing the workflow, deploying the serverless worker, and testing the API with Postman.

ComfyUIRunPod ServerlessImage-to-3DNetwork StorageFree GuidePaid Pack $5

Video Preview

Paid section · $5 one-time

Skip the DIY setup. Get ready-made worker files, workflow, Postman collection, and app.

Paid · Starter Pack · $5

Image-to-3D AI Serverless Starter Pack

Build your own image-to-3D AI app with ComfyUI and RunPod Serverless for just $5. Skip the tedious setup and get the ready-made files you need to turn a 2D image into a downloadable 3D model using cloud GPU processing.

What's included

✓
Ready-made Serverless Worker
Modified RunPod worker files configured to return generated 3D models in GLB format.
✓
ComfyUI API Workflow
Prepared image-to-3D workflow with the required save nodes and model configuration.
✓
Postman Testing Collection
Submit images, test your endpoint, and retrieve generation results.
✓
Image-to-3D App
Upload an image, adjust generation settings, click Generate, and download your 3D model.
✓
Base64-to-GLB Converter
Convert API output into a usable 3D file without manual decoding.
✓
Written Setup Guides
Step-by-step instructions for deployment, configuration, and testing.

Who is this for?

Developers, AI builders, and creators who want to build an image-to-3D generation service without starting from scratch.

Customize it your way: Use the app as provided, vibe-code additional features, or integrate it into your existing project.

Price: $5 one-time. Pay with crypto. Access details are emailed after payment is confirmed.

Note: A RunPod account, GPU usage credits, and any applicable infrastructure costs are separate. You will need to configure your own endpoint and model storage.

Free section · DIY guide

Free Tutorial Guide

Follow the full walkthrough below for free — set up Network Storage, ComfyUI, the serverless worker, and Postman testing yourself. Prefer ready-made files? Use the Paid Pack ($5) above.

RunPod referral

Get up to $500 bonus credits

Sign up with this referral and deposit $10 to unlock a one-time credit bonus between $5–$500. You'll need RunPod for GPU pods and serverless endpoints in this tutorial.

Referral code
ckrxhc11

What you'll need

  • ✓A RunPod account with available credits (use the referral above for bonus credits)
  • ✓A GitHub account
  • ✓An image-to-3D ComfyUI workflow
  • ✓The required model files and enough Network Storage capacity
  • ✓Postman + this collection

What you'll learn

  • ✓Set up Network Storage for persistent AI models
  • ✓Deploy and validate an image-to-3D ComfyUI workflow
  • ✓Prepare a RunPod Serverless worker for 3D file returns
  • ✓Deploy a serverless endpoint with attached storage
  • ✓Test image-to-3D jobs with Postman and decode GLB output
  • ✓Connect the endpoint to a secure application backend

Free Full Walkthrough

Free DIY steps — no purchase required

1

Create Network Storage

Log in to RunPod and navigate to Network Storage.

  1. Create new Network Storage.
  2. Select an available region.
  3. Choose enough storage for all the models required by your workflow.
  4. Create the storage and wait until it is ready.

We'll use this storage to keep our AI models separate from the temporary ComfyUI environment.

2

Deploy a ComfyUI Pod

Go to Pods ? Deploy a Pod.

  1. Select the ComfyUI template.
  2. Attach the Network Storage created in Step 1 and configure its mount path.
  3. Select a GPU with sufficient VRAM for your image-to-3D workflow.
  4. Review the configuration and deploy the Pod.

Wait for the Pod to start and open the ComfyUI interface.

3

Install and test the workflow

Before preparing the serverless worker, make sure the workflow runs correctly.

  1. Open ComfyUI Manager and update ComfyUI and the required components according to the workflow's compatibility requirements.
  2. Download and import the image-to-3D workflow: aikitty-img-to-3d-ui-workflow.json
  3. Install any missing custom nodes.
  4. Download the missing models into the appropriate ComfyUI model directories.
  5. Upload a test image and run the workflow.

Confirm that the workflow generates the expected 3D output. The workflow must save an actual 3D file, such as GLB, rather than only displaying a preview.

4

Move the models to Network Storage

Once the workflow works, stop the ComfyUI process and open Jupyter Notebook through your Pod.

Locate the ComfyUI models directory and copy the required model files into Network Storage. Preserve the necessary folder structure and verify that the files have transferred correctly.

Make sure you include all required model components, not just the main model.

After verifying the transfer, you can remove the temporary ComfyUI installation if it is no longer needed. Double-check the paths before deleting anything.

Finally, stop and terminate the Pod. The models will remain in Network Storage, provided you do not delete the storage itself.

5

Prepare the RunPod Serverless worker

Start with the official RunPod serverless-workers repository:

https://github.com/runpod/serverless-workers

Important: The default worker may not support returning 3D files from your workflow. You need to modify the handler, configure model paths, and use a compatible API workflow.

You can make these modifications manually or use the AI coding prompt below with an AI coding agent. Provide the official repository and your actual ComfyUI API workflow together with the prompt.

AI coding prompt

Copy the prompt below and provide it to your coding agent along with the official repository and your actual ComfyUI API workflow.

Modify the official RunPod serverless-workers repository to support image-to-3D generation using ComfyUI and an image-to-3D workflow.

Inspect the repository structure, handler implementation, ComfyUI integration, Docker configuration, and the supplied API workflow before making changes. Do not assume the existing image-generation handler can return 3D files without modification.

Implement the following requirements:

1. Return generated 3D models from handler.py
- Read generated files from ComfyUI history outputs under the 3d key, with support for mesh where applicable.
- Identify actual saved 3D files produced by the workflow.
- Read the generated files and encode their binary contents as base64.
- Return the results under output.models_3d using this structure:

{
  "output": {
    "models_3d": [
      {
        "filename": "output.glb",
        "data": "<BASE64_ENCODED_GLB>"
      }
    ]
  }
}

- Keep output.images reserved for actual saved image outputs.
- Do not treat preview-only nodes as successful 3D file outputs.
- Handle missing files, generation errors, and empty outputs explicitly.

2. Configure additional model paths
Update src/extra_model_paths.yaml to expose all required model directories to ComfyUI on the worker.
Include the additional model types required by the supplied workflow, such as background-removal models and MoGe geometry models, where applicable.
Use the actual Network Storage mount configuration and expected directory structure. Do not invent model filenames or assume that the models are available in the container by default.

3. Test the complete pipeline
Provide an API-format workflow file, the modified handler, the extra model paths configuration, and all required deployment changes.
Test the handler with a representative image-to-3D request. Verify that the job completes and returns a non-empty output.models_3d array containing valid base64 data that can be decoded into a GLB file.
Preserve compatibility with the repository's existing architecture. Do not remove unrelated functionality. Report any tests that could not be run and provide clear instructions for building and deploying the worker.
Do not claim that the implementation is working until it has been tested against the actual workflow and runtime.

Expected response shape

{
  "output": {
    "models_3d": [
      {
        "filename": "output.glb",
        "data": "<BASE64_ENCODED_GLB>"
      }
    ]
  }
}
6

Upload the worker to GitHub

Once the modifications are complete:

  1. Review the generated code and configuration files.
  2. Confirm that the handler returns 3D model data rather than only image outputs.
  3. Upload the modified worker to your GitHub repository.
  4. Make sure the repository includes the required Docker and dependency configuration.

Alternatively, you can build a Docker image and push it to a supported container registry. This guide uses GitHub for deployment.

7

Deploy the Serverless endpoint

Open RunPod Serverless and create a new endpoint.

  1. Connect your GitHub account and grant RunPod access to the repository.
  2. Select your repository and the appropriate worker configuration.
  3. Choose a GPU with sufficient VRAM.
  4. Configure the worker settings. You can increase the maximum number of workers to five if your expected workload requires it; this is optional and can increase costs.
  5. Attach your Network Storage and ensure the worker can access the model files at the configured paths.
  6. Review the configuration and deploy.

The initial deployment can take around 20 minutes, depending on the image, dependencies, and build process. Later deployments may be faster when existing build layers can be reused. Wait until the endpoint is ready before testing it.

8

Test with Postman

Download Postman: https://www.postman.com/

Import the prepared Postman collection: RunPod Tutorial.postman_collection.json — or create the requests described below.

Configure your variables

  • endpoint_id: Your RunPod Serverless endpoint ID.
  • runpod_api_key: Your RunPod API key.

Keep your API key private. Do not publish it in a public repository or expose it in a frontend application.

Submit an asynchronous request

Open your Run (Async) request and inspect the Body tab. The API body should contain the workflow input expected by your handler. Find the input.png field and supply your input image as base64 data.

You can use an image-to-base64 converter to convert a PNG image into a base64 string. If your handler expects a raw base64 string, do not include an unnecessary data URL prefix such as data:image/png;base64,.

Check the job status

The response should contain a job ID. Copy the ID and use it in your Get Status request. Send the request again after a short interval until the job reaches a terminal status.

When the job completes, inspect the returned JSON and locate:

  • output.models_3d[0].data: The base64-encoded GLB.
  • output.models_3d[0].filename: The generated filename.

If the job completes but models_3d is empty, inspect the ComfyUI history output, save-node connections, and handler extraction logic.

Convert the result into a GLB file

Copy the base64 value from output.models_3d[0].data, excluding the surrounding JSON syntax. Decode the base64 data into a binary file using a suitable base64-to-file converter or a local script. Save it with a .glb extension and open it in a compatible 3D viewer to verify the model.

9

Connect the endpoint to an application

Postman is useful for testing, but it is not a convenient interface for regular users.

A frontend application can provide an image upload field, generation settings, a Generate button, progress feedback, and a download link for the finished model.

The application should submit the image to your backend, which securely communicates with RunPod Serverless and polls or receives job completion updates. Once the job finishes, the app can make the resulting GLB available to the user.

Security note: Do not expose your RunPod API key in browser-side JavaScript. Use a backend to authenticate requests and protect the credentials.

Troubleshooting

ProblemWhat to check
Missing model errorsModel paths, storage mount, and required files
Workflow validation errorsAPI workflow format, node inputs, and custom-node compatibility
Job completes without a GLBSave-node connections and handler output extraction
Empty models_3d outputComfyUI history keys and actual saved files
Oversized responseGLB size, textures, mesh complexity, and endpoint limits
Out-of-memory errorsGPU VRAM and workflow settings
Serverless worker cannot find modelsNetwork Storage attachment and mount paths

Final result

You now have the foundation for an image-to-3D generation pipeline using ComfyUI and RunPod Serverless. You can submit an image, run the workflow on a cloud GPU, and retrieve the generated 3D model through the API.

The key is to verify each stage independently: first the ComfyUI workflow, then model storage, the serverless handler, and finally the complete API request.