> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-mintlify-theme-mint.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Comfy API and Router examples

> Starting points for Comfy Router models and deployed ComfyUI workflows, plus full demo apps you can deploy and adapt.

Pick the path that matches what you want to run.

## Model APIs

Use Comfy Router to call hosted partner models with one Comfy API key.

<CardGroup cols={2}>
  <Card title="Generate an image" icon="image" href="/development/comfy-router/quickstart">
    Make your first image with Flux in Python, TypeScript, or cURL.
  </Card>

  <Card title="Browse available models" icon="magnifying-glass" href="/development/comfy-router/models">
    Find a model, inspect its inputs, and copy its model ID.
  </Card>

  <Card title="Use a model's schema" icon="list-tree" href="/development/comfy-router/models/black-forest-labs/flux-2-pro/code">
    See the request and response shape for a Router model.
  </Card>

  <Card title="Call Router over HTTP" icon="terminal" href="/development/comfy-router/reference">
    Look up the shared Router endpoints and headers.
  </Card>
</CardGroup>

## Comfy API

Package your own ComfyUI workflow, deploy it to managed GPU infrastructure, and run it through the Comfy API.

<CardGroup cols={2}>
  <Card title="Deploy a workflow" icon="cloud-arrow-up" href="/development/serverless/overview#quick-start">
    Create a Build, release it, and start a managed deployment.
  </Card>

  <Card title="Choose compute" icon="microchip" href="/development/serverless/overview#regions-and-gpu-availability">
    Find the available regions and GPU classes before you deploy.
  </Card>

  <Card title="Run a deployed workflow" icon="play" href="/development/serverless/overview#4-run-a-workflow">
    Submit an API-format workflow and download its outputs.
  </Card>

  <Card title="Use the SDK" icon="code" href="/development/api-development/sdks#serverless-deployment">
    Point the Python or TypeScript SDK at your deployment.
  </Card>
</CardGroup>

## Full Demos

Start from a complete demo app, then adapt the workflow and interface for your own project. Choose Comfy Cloud for the fastest path, or Deploy Your Own when you need your own models or nodes.

<div className="sample-card-grid">
  <div className="sample-card" data-sample-card="true">
    <div className="sample-card-inner">
      <div className="sample-card-face sample-card-front" data-sample-front="true">
        <img src="https://mintcdn.com/dripart-chore-mintlify-theme-mint/lyhXnanmKiLu3hzG/images/samples/img2img-web-app.svg?fit=max&auto=format&n=lyhXnanmKiLu3hzG&q=85&s=a2f7ad9e99e40f5f1e2565baf7aa8a53" alt="Preview of the image-to-image web app" className="sample-card-preview" data-sample-preview="api" noZoom="true" width="960" height="540" data-path="images/samples/img2img-web-app.svg" />

        <div className="sample-card-body">
          <h2>Image-to-image web app</h2>
          <p>Upload an image, run a Comfy workflow, and show the result in a Next.js app.</p>

          <div className="sample-card-actions">
            <button type="button" data-sample-open="api">Use Comfy Cloud</button>
            <button type="button" data-sample-open="endpoint">Deploy Your Own</button>
          </div>

          <div className="sample-card-links">
            <a href="https://github.com/Comfy-Org/comfy-examples/blob/main/img2img-web-app/workflows/workflow_api.json?raw=1">Download workflow ↗</a><span>·</span><a href="https://github.com/Comfy-Org/comfy-examples/tree/main/img2img-web-app">View source ↗</a>
          </div>
        </div>
      </div>

      <div className="sample-card-face sample-card-back" data-sample-path="api" aria-hidden="true" inert="true">
        <div className="sample-path-body">
          <button type="button" data-sample-back="true">← Back to demo app</button>
          <p className="sample-path-eyebrow">Comfy Cloud</p><h2>Use Image-to-image web app with Comfy Cloud</h2>
          <p>Use Comfy Cloud as the managed endpoint. Create an API key, then deploy a copy of the app.</p>

          <div className="sample-path-steps">
            <div className="sample-path-step"><span className="sample-path-number">1</span><div className="sample-path-copy"><strong>Create API key</strong><span>Create and save a Comfy API key. An eligible Comfy Cloud subscription is also required.</span></div><a href="https://platform.comfy.org/profile/api-keys">Create API key ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">2</span><div className="sample-path-copy"><strong>Deploy app to Vercel</strong><span>The provider creates a copy of this sample in your account.</span></div><a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FComfy-Org%2Fcomfy-examples%2Ftree%2Fmain%2Fimg2img-web-app&env=COMFY_BASE_URL%2CCOMFY_API_KEY&envDefaults=%7B%22COMFY_BASE_URL%22%3A%22https%3A%2F%2Fcloud.comfy.org%22%7D">Deploy app ↗</a></div>
          </div>
        </div>
      </div>

      <div className="sample-card-face sample-card-back" data-sample-path="endpoint" aria-hidden="true" inert="true">
        <div className="sample-path-body">
          <button type="button" data-sample-back="true">← Back to demo app</button>
          <p className="sample-path-eyebrow">Deploy Your Own</p><h2>Deploy your own endpoint for Image-to-image web app</h2>
          <p>Create a Comfy API serverless endpoint when you need your own models or custom nodes.</p>

          <div className="sample-path-steps">
            <div className="sample-path-step"><span className="sample-path-number">1</span><div className="sample-path-copy"><strong>Download workflow</strong><span>Use this API-format workflow in the dedicated deployment flow.</span></div><a href="https://github.com/Comfy-Org/comfy-examples/blob/main/img2img-web-app/workflows/workflow_api.json?raw=1">Download workflow ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">2</span><div className="sample-path-copy"><strong>Create API key</strong><span>Create and save the key your deployed app will use.</span></div><a href="https://platform.comfy.org/profile/api-keys">Create API key ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">3</span><div className="sample-path-copy"><strong>Paste Workflow and Deploy</strong><span>In Builds, paste the workflow, configure the endpoint, and wait for its URL.</span></div><a href="https://platform.comfy.org/profile/builds">Open builds ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">4</span><div className="sample-path-copy"><strong>Paste endpoint URL and API key</strong><span>Set COMFY\_BASE\_URL and COMFY\_API\_KEY during app deployment.</span></div><a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FComfy-Org%2Fcomfy-examples%2Ftree%2Fmain%2Fimg2img-web-app&env=COMFY_BASE_URL%2CCOMFY_API_KEY">Deploy app ↗</a></div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div className="sample-card" data-sample-card="true">
    <div className="sample-card-inner">
      <div className="sample-card-face sample-card-front" data-sample-front="true">
        <img src="https://mintcdn.com/dripart-chore-mintlify-theme-mint/lyhXnanmKiLu3hzG/images/samples/sketch-to-image.svg?fit=max&auto=format&n=lyhXnanmKiLu3hzG&q=85&s=ee532cd34196f02e6f54ae15de8ac10b" alt="Preview of the sketch-to-image app" className="sample-card-preview" data-sample-preview="api" noZoom="true" width="960" height="540" data-path="images/samples/sketch-to-image.svg" />

        <div className="sample-card-body">
          <h2>Sketch to image</h2><p>Draw or import a guide, then generate an image from the guide and a prompt.</p>
          <div className="sample-card-actions"><button type="button" data-sample-open="api">Use Comfy Cloud</button><button type="button" data-sample-open="endpoint">Deploy Your Own</button></div>
          <div className="sample-card-links"><a href="https://github.com/Comfy-Org/comfy-examples/blob/main/sketch-to-image/workflows/workflow_api.json?raw=1">Download workflow ↗</a><span>·</span><a href="https://github.com/Comfy-Org/comfy-examples/tree/main/sketch-to-image">View source ↗</a></div>
        </div>
      </div>

      <div className="sample-card-face sample-card-back" data-sample-path="api" aria-hidden="true" inert="true">
        <div className="sample-path-body">
          <button type="button" data-sample-back="true">← Back to demo app</button>
          <p className="sample-path-eyebrow">Comfy Cloud</p>
          <h2>Use Sketch to image with Comfy Cloud</h2>
          <p>Use Comfy Cloud as the managed endpoint. Create an API key, then deploy a copy of the app.</p>

          <div className="sample-path-steps">
            <div className="sample-path-step"><span className="sample-path-number">1</span><div className="sample-path-copy"><strong>Create API key</strong><span>Create and save a Comfy API key. An eligible Comfy Cloud subscription is also required.</span></div><a href="https://platform.comfy.org/profile/api-keys">Create API key ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">2</span><div className="sample-path-copy"><strong>Deploy app to Vercel</strong><span>The provider creates a copy of this sample in your account.</span></div><a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FComfy-Org%2Fcomfy-examples%2Ftree%2Fmain%2Fsketch-to-image&env=COMFY_BASE_URL%2CCOMFY_API_KEY&envDefaults=%7B%22COMFY_BASE_URL%22%3A%22https%3A%2F%2Fcloud.comfy.org%22%7D">Deploy app ↗</a></div>
          </div>
        </div>
      </div>

      <div className="sample-card-face sample-card-back" data-sample-path="endpoint" aria-hidden="true" inert="true">
        <div className="sample-path-body">
          <button type="button" data-sample-back="true">← Back to demo app</button>
          <p className="sample-path-eyebrow">Deploy Your Own</p>
          <h2>Deploy your own endpoint for Sketch to image</h2>
          <p>Create a Comfy API serverless endpoint when you need your own models or custom nodes.</p>

          <div className="sample-path-steps">
            <div className="sample-path-step"><span className="sample-path-number">1</span><div className="sample-path-copy"><strong>Download workflow</strong><span>Use this API-format workflow in the dedicated deployment flow.</span></div><a href="https://github.com/Comfy-Org/comfy-examples/blob/main/sketch-to-image/workflows/workflow_api.json?raw=1">Download workflow ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">2</span><div className="sample-path-copy"><strong>Create API key</strong><span>Create and save the key your deployed app will use.</span></div><a href="https://platform.comfy.org/profile/api-keys">Create API key ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">3</span><div className="sample-path-copy"><strong>Paste Workflow and Deploy</strong><span>In Builds, paste the workflow, configure the endpoint, and wait for its URL.</span></div><a href="https://platform.comfy.org/profile/builds">Open builds ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">4</span><div className="sample-path-copy"><strong>Paste endpoint URL and API key</strong><span>Set COMFY\_BASE\_URL and COMFY\_API\_KEY during app deployment.</span></div><a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FComfy-Org%2Fcomfy-examples%2Ftree%2Fmain%2Fsketch-to-image&env=COMFY_BASE_URL%2CCOMFY_API_KEY">Deploy app ↗</a></div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div className="sample-card" data-sample-card="true">
    <div className="sample-card-inner">
      <div className="sample-card-face sample-card-front" data-sample-front="true">
        <img src="https://mintcdn.com/dripart-chore-mintlify-theme-mint/lyhXnanmKiLu3hzG/images/samples/discord-image-bot.svg?fit=max&auto=format&n=lyhXnanmKiLu3hzG&q=85&s=471fa448fdb0b409420293ff007cd647" alt="Preview of the Discord image bot" className="sample-card-preview" data-sample-preview="api" noZoom="true" width="960" height="540" data-path="images/samples/discord-image-bot.svg" />

        <div className="sample-card-body">
          <h2>Discord image bot</h2><p>Add an `/imagine` command to a Discord server and run the bundled Comfy workflow.</p>
          <div className="sample-card-actions"><button type="button" data-sample-open="api">Use Comfy Cloud</button><button type="button" data-sample-open="endpoint">Deploy Your Own</button></div>
          <div className="sample-card-links"><a href="https://github.com/Comfy-Org/comfy-discord-image-bot/blob/main/workflows/workflow_api.json?raw=1">Download workflow ↗</a><span>·</span><a href="https://github.com/Comfy-Org/comfy-discord-image-bot">View source ↗</a></div>
        </div>
      </div>

      <div className="sample-card-face sample-card-back" data-sample-path="api" aria-hidden="true" inert="true">
        <div className="sample-path-body">
          <button type="button" data-sample-back="true">← Back to demo app</button>
          <p className="sample-path-eyebrow">Comfy Cloud</p>
          <h2>Use Discord image bot with Comfy Cloud</h2>
          <p>Use Comfy Cloud as the managed endpoint. Create an API key, then deploy a copy of the app.</p>

          <div className="sample-path-steps">
            <div className="sample-path-step"><span className="sample-path-number">1</span><div className="sample-path-copy"><strong>Create API key</strong><span>Create and save a Comfy API key. An eligible Comfy Cloud subscription is also required.</span></div><a href="https://platform.comfy.org/profile/api-keys">Create API key ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">2</span><div className="sample-path-copy"><strong>Deploy app to Render</strong><span>The provider creates a copy of this sample in your account.</span></div><a href="https://render.com/deploy?repo=https%3A%2F%2Fgithub.com%2FComfy-Org%2Fcomfy-discord-image-bot">Deploy app ↗</a></div>
          </div>
        </div>
      </div>

      <div className="sample-card-face sample-card-back" data-sample-path="endpoint" aria-hidden="true" inert="true">
        <div className="sample-path-body">
          <button type="button" data-sample-back="true">← Back to demo app</button>
          <p className="sample-path-eyebrow">Deploy Your Own</p>
          <h2>Deploy your own endpoint for Discord image bot</h2>
          <p>Create a Comfy API serverless endpoint when you need your own models or custom nodes.</p>

          <div className="sample-path-steps">
            <div className="sample-path-step"><span className="sample-path-number">1</span><div className="sample-path-copy"><strong>Download workflow</strong><span>Use this API-format workflow in the dedicated deployment flow.</span></div><a href="https://github.com/Comfy-Org/comfy-discord-image-bot/blob/main/workflows/workflow_api.json?raw=1">Download workflow ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">2</span><div className="sample-path-copy"><strong>Create API key</strong><span>Create and save the key your deployed app will use.</span></div><a href="https://platform.comfy.org/profile/api-keys">Create API key ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">3</span><div className="sample-path-copy"><strong>Paste Workflow and Deploy</strong><span>In Builds, paste the workflow, configure the endpoint, and wait for its URL.</span></div><a href="https://platform.comfy.org/profile/builds">Open builds ↗</a></div>
            <div className="sample-path-step"><span className="sample-path-number">4</span><div className="sample-path-copy"><strong>Paste endpoint URL and API key</strong><span>Set COMFY\_BASE\_URL and COMFY\_API\_KEY during app deployment.</span></div><a href="https://render.com/deploy?repo=https%3A%2F%2Fgithub.com%2FComfy-Org%2Fcomfy-discord-image-bot">Deploy app ↗</a></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<Note>
  Both paths need a [Comfy API key](https://platform.comfy.org/profile/api-keys). For Deploy Your Own, download the workflow, use Builds to paste it and configure the serverless endpoint, wait for its URL, then paste that URL and the API key into your Vercel or Render deployment.
</Note>

Want to add a demo app? See the [examples repository](https://github.com/Comfy-Org/comfy-examples).
