Railway

Deploy BabyChain

Every output becomes the next input.

Deploy BabyChain

Just deployed

Deploy and Host babychain on Railway

BabyChain is an API-first starter for chaining image and video generation steps into one durable run. It exposes chain templates for text-to-image into image-to-video, image-to-image into image-to-video, and three-step image transformation flows before final video output.

Use it when you want callers to submit one request, let each model output become the next model input, and receive one signed final callback. The starter supports BabySea mode or BYOK mode with server-side Black Forest Labs and BytePlus credentials, while Supabase stores runs, steps, callbacks, and API-key state.

About Hosting

A caller starts in the API surface by listing available templates or posting to a specific chain route with Authorization: Bearer BABYCHAIN_API_KEY. BabyChain validates the chain input against the template schema, rejects credential-like request fields, checks safe HTTPS input files, estimates the run, stores the run and step records in Supabase, and returns the public run resource immediately.

The processor resumes queued work through the server runner. For each ready step, it resolves the selected model, chooses BabySea or BYOK provider execution, starts the generation, and records provider metadata needed to poll without exposing provider secrets to the caller.

When a step succeeds, BabyChain reads the output file URL and injects it into the dependent input for the next step. That is how a text-to-image result becomes an image-to-video source, or how a generated image is restyled before final video creation in the three-step chain.

After every step reaches a terminal state, the run presenter returns a single caller-facing resource and the callback worker sends one signed JSON payload to the configured webhook URL. API consumers can still retrieve or cancel runs, but they do not need to coordinate individual provider jobs themselves.

Common Use Cases

  • Public API endpoints for listing chain templates, creating runs, polling runs, and canceling runs.
  • text-to-image then image-to-video chains using FLUX or Seedream image models and Seedance video models.
  • image-to-image then image-to-video chains that accept safe HTTPS image inputs.
  • Three-step text-to-image, image-to-image, and image-to-video workflows with one final callback.
  • BYOK or BabySea-backed execution with cost estimates, provider polling, and terminal status delivery.

Dependencies for babychain Hosting

  • Next.js for API routes, route handlers, and the server runner.
  • Supabase for run records, step records, API callers, callback state, and migrations.
  • BabyChain secrets for BABYCHAIN_API_KEY, BABYCHAIN_CRON_SECRET, and BABYCHAIN_CALLBACK_SECRET.
  • BabySea for hosted image and video execution when BABYCHAIN_PROVIDER_MODE=babysea.
  • Black Forest Labs for BYOK FLUX image model execution.
  • BytePlus for BYOK Seedream and Seedance model execution.
  • Upstash for Redis-backed caller API rate limiting.
  • Sentry for optional production observability.
  • For hosting, you can deploy using Cloudflare, Netlify, Railway, Render, or Vercel.

Deployment Dependencies

https://github.com/babysea-community/babychain

Why Deploy babychain on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying babychain on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta