app.nzapp
AppsProjectsReposPullsChatIntegrationsGatewayModelsEvalsToolsDatasetsMCPDeploysPricingBlogDocsAssistantsCharactersArtMusic
Sign inStart building
Agent stack
Cloud coding agentAgents SDKIntegrationsBrowser agentMonitors & auto-agentsSchedulersAgent skillsMCP serversDeep research
Models & API
AI GatewayModel catalogModel evalsModel spacesPlaygroundText to imageImage to 3DText to 3DMusic & SFXAudio editorMedia optimizerAI art & libraryChatAPI referenceSchemaBecome a provider
Compute & hosting
DeploysAddonsPostgres hostinggobed vector searchSite hostingAnalyticsCog GPU hostingRL trainingBuilds & CIWorkersTask queuesDomainsGit hosting
Tools
AI toolsDrawDiffusion canvasLive DrawWriteSheetsArtifactsVideo studioNotebooksDatasets
Learn
DocsBlogEval guidesPrompt libraryCLIAlternativesPapersAI charactersArt gallerySecurityConsulting
Company
PricingEnterpriseSettingsBillingStatusInvestorsCreate accountTerms of ServicePrivacy Policy
app.nzapp.nz

AI agent cloud for coding, deploys, model routing, and research. Built for teams shipping software.

Built in New Zealand by App AI NZ.

Social
X / TwitterGitHubYouTube
The app.nz network
GpuBrainPapersReading TimemojojojoNetwrckText-Generator.ioCodex InfinityOpenPathsCuteDSLAI Art GeneratorAIArt-Generator.artSiteSimSimplexGenDictatorFlowWebFiddleRing.nzChatGibidyBitBankExperimentFlowEvangelerHires.nzHow.nzV5 GamesAddicting Word GamesBig Multiplayer ChessWord SmashingreWord GameMultiplication Master
© 2026 App AI NZ Ltd. All rights reserved.All systems normalTermsPrivacy
Blog
July 22, 2026·10 min read·app.nz

From ComfyUI to any Cog: open audio workflows that scale to zero

How template:name connects ComfyUI to reusable Cog deployments, when to choose open Pocket TTS versus fal audio, and how the shared serverless/pod router returns idle workers to zero.

Listen to this article

On-device voice

Uses the voice built into your browser; no article text leaves this page.

Audio narration is not supported by this browser.

An audio workflow should describe what to run, not require somebody to copy a temporary pod URL into a node. We have connected ComfyUI to app.nz's Cog control plane so a graph can name an open recipe such as pocket-tts, submit work, and let the worker disappear when it is no longer useful.

The runnable graph is Autoscaling Open TTS Cog. Download its exact ComfyUI API JSON or inspect the workflow contract.

The first principle: deployment and execution are different state

A model deployment is durable configuration: image digest, schema, hardware, minimum VRAM, and idle policy. A worker is temporary compute. Combining those ideas leads to a simple lifecycle:

template:pocket-tts
        │
        ▼
ensure one deployment
(reuse it when it already exists)
        │
        ▼
queue prediction
low traffic → serverless
sustained traffic → warm pod
        │
        ▼
return AUDIO to Comfy
idle window expires → zero workers

Repeated graph runs do not create repeated models. POST /api/cogs/run uses a single atomic ensure operation keyed by account, deployment name, image, and hardware. It returns the model id, prediction id, polling URL, explicit sleep URL, idle window, and scaleToZero: true.

Run the graph

Install the MIT app.nz Comfy nodes, set APPNZ_API_KEY in the worker environment, import the downloaded workflow, and change the text or voice. The AppNZCogAudio node does four visible jobs:

  1. asks the control plane to ensure the named template;
  2. queues a normal Cog prediction;
  3. polls the public prediction state until it reaches a terminal result;
  4. converts the returned URL or audio data URI into a normal Comfy AUDIO value.

The generic AppNZAnyCog node accepts the same template:name reference for image, video, 3D, JSON, and custom models. An existing model id still works, so the shortcut does not hide the lower-level hosting API.

The same lifecycle without ComfyUI

# Ensure pocket-tts, run it, wait for the result, then let the 60s idle policy reap it.
app cogs run pocket-tts \
  --input '{"text":"Kia ora from a worker that scales to zero","voice":"alba","format":"wav"}'

# Or use the API directly.
curl -sX POST https://app.nz/api/cogs/run \
  -H "Authorization: Bearer $APP_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"template":"pocket-tts","input":{"text":"hello","voice":"alba","format":"wav"}}'

MCP clients use run_cog_template, then get_cog_prediction. The Go desktop bridge exposes /api/desktop/cogs/run, and its built-in MCP server offers cog_template_run. All of them hit the same queue and lifecycle records.

Cog audio or fal audio?

These paths solve different problems:

NeedBest first pathWhy
Narration, local voices, inspectable servingPocket TTS CogSmall 100M model, MIT serving code, CC-BY-4.0 weights, CPU-friendly, voice cloning, deployment under your control
First-party higher-quality speechappnz-tts CogFish Speech adapter with reusable model cache and serverless/pod promotion
Foley, impacts, UI soundselevenlabs-sound-effects through falPurpose-built prompt-to-SFX endpoint; no model deployment to maintain
Beds, loops, long musical texturestable-audio-25 through falText-to-audio model with duration, steps, guidance, and seed controls
Audio-reactive graphicsLocal Comfy nodeWaveform/FFT work is deterministic CPU math and needs no inference service

Both fal audio models are now explicit entries in the app.nz model catalogue, so /v1/audio/generations and the AppNZSoundFX node resolve the same IDs. The fal route remains hosted by fal; app.nz does not falsely claim to control its worker lifecycle. Cog routes use app.nz's own serverless/pod scheduler and idle reaper.

Open-source boundaries and licenses

  • Pocket TTS has MIT code and is

designed for low-latency CPU execution. Its model weights are CC-BY-4.0, individual bundled voices can carry separate attribution requirements, and cloning requires explicit authorization from the speaker.

  • The pocket-tts Cog adapter and

app.nz Comfy nodes are open adapters around that runtime.

  • stable-audio-tools is MIT,

but model weights have their own terms. Open code does not automatically make every checkpoint an OSI-licensed model.

  • Stock Cog containers expose typed OpenAPI and prediction endpoints.

app.nz speaks that contract directly; a compliant image does not need a proprietary wrapper.

What actually scales to zero

"Scale to zero" should be observable, not decorative copy. A run returns the chosen tier and prediction state. A low-rate serverless-enabled template can run without a dedicated pod. Sustained demand promotes to a warm pod through the shared Cog/Comfy GPU router. After the model's idle window, the reaper verifies there are no active predictions, terminates the provider machine, and clears the endpoint. Calling the returned sleep URL performs the same teardown immediately.

This boundary also keeps Comfy graphs portable: the workflow stores template:pocket-tts, never a provider pod id or secret. Credentials remain in the worker environment, media moves as HTTPS URLs or data URIs, and the graph can be reviewed without gaining infrastructure access.

Extend it to any Cog

For a custom model, publish a container that serves /health-check, /openapi.json, and /predictions on port 5000. Register it once with POST /api/cogs or the deploy badge, then use its returned model id in AppNZAnyCog. To make it a one-word ensure-and-run recipe, contribute the image, schema, source repository, upstream project, licenses, minimum VRAM, and idle policy to the public Cog template catalogue.

The governing rule is small but useful: keep the recipe durable, keep compute temporary, and keep every license and lifecycle transition inspectable.

Build what you just read

Ship agents, models, and apps on one cloud.

Start with free credits, then use the same platform from the web app, CLI, desktop app, or MCP.

Start building freeRead the docs

Keep reading

Packaging MiniMax H3 for Cog, R2, RTX 5090, and scale to zero

A careful H3 video workflow with text, keyframes, native audio, true loops, verified R2 weights, GPU AV1, serverless pricing, and a fail-closed license gate.

Train three open piano models, then deploy one Cog anywhere

A reproducible CC0 symbolic training pipeline, listening previews, one inference image for Cog and RunPod Serverless, and one-click scale-to-zero deployment on app.nz.

Accelerating MiniMax H3 carefully: signed EasyCache sweeps and audiovisual gates

How app.nz tests H3 denoising caches with private signed controls, fixed-seed A/B jobs, runtime telemetry, and first/last-frame, audio, and loop quality gates.