Case Study/AI & Agents/Design, engineering, maintenance

Node-Based AI Media Studio

Author
Aryan
Client
Self-serve AI product
Published
2026
Length
7 min · 1525 words

Abstract

Self-hosted node canvas for chaining image and video models into reusable generation pipelines.

Key outcomes

Canvas
Node graph
Outputs
Image + video
Hosting
Self-hosted

Why the pipeline needs a node canvas

An image or video model is consumed one prompt at a time, and that interface works until anything needs to be repeated. A house style, a consistent character, a two-step reframe where an image is generated for reference and then animated. Each of those is a small pipeline, and a prompt box makes the operator retype the pipeline by hand on every run, which is how a consistent result quietly becomes an inconsistent one.

Hosted workflow builders solve the repetition, but they solve it in a way that keeps the graph on someone else’s servers, meters execution per credit, and resets those credits on a schedule the operator does not control. This build inverts both properties. It runs on infrastructure the operator owns, and the pipeline is a saved artifact rather than a rented one.

That framing is the whole design brief. Everything below is a consequence of treating the graph as the primary object and generation as a job that operates on it.

The graph is the artifact

A pipeline is a directed graph of nodes and edges. Nodes carry the generation parameters, which model to call, the prompt text, and any reference assets attached to the node. Edges express dependency: which node’s output feeds which node’s input, and therefore what order execution has to follow.

Canvas interaction is handled by React Flow, which brings viewport management, node dragging and edge creation as a library rather than a project. The graph data itself is held in a Zustand store, separate from the component tree. That split matters more than it looks. React Flow owns where a node sits on screen; the store owns what the node is. Rendering a hundred nodes should not mean re-rendering the execution model, and keeping the two in different layers is what prevents the canvas from becoming the source of truth for the pipeline.

Persistence treats the graph as a document. The node and edge set, along with the parameters inside each node, is serialized and stored, so reopening a pipeline restores both the structure and the configuration. Supabase provides the storage layer, which means the graph is a row rather than a file on the server’s local disk, and it survives a redeploy.

Execution is handled as a background job

The single most important split in the system is between editing a graph and running it.

An image generation call is slow by web standards. A video generation call is slower by an order of magnitude, and can run for minutes. If execution were bound to the request that started it, the editor would be blocked behind the slowest node, and a browser refresh would abandon work that the provider is still running and still billing for.

So a run is a job. Submitting a graph starts execution and returns immediately, and the editor remains usable while nodes report progress. The client tracks job state through a dedicated status endpoint and a streaming channel, rather than by polling the generation endpoints directly. Node state, pending, running, complete or failed, is what the canvas renders, so a long render looks like a node with a progress state rather than a frozen interface.

Separating the job from the request also makes partial results meaningful. A five-node graph where the fourth fails has produced three usable outputs, and those stay attached to their nodes. Treating the run as all-or-nothing would have thrown them away.

Reference assets and the storage boundary

Generated media cannot live in the same place as the graph. Images and videos are large, they are downloaded and re-uploaded, and serving them from the application process would put media bandwidth on the same bill as page rendering. Outputs go to S3-compatible object storage, and the graph stores references rather than bytes. The same boundary applies to inputs: a reference image is uploaded once and referenced by identifier, so a pipeline that uses the same character reference across ten nodes stores it once.

Reference assets are not only generated outputs. The system supports uploading assets directly, and it supports pulling a frame out of an existing video to use as an input image, which is the practical way to keep continuity between shots. Video trimming is handled the same way, as an operation that produces a new asset rather than mutating an existing one, because a pipeline that reused a trimmed file would be non-reproducible once the original changed.

Keeping asset identity separate from asset content is what makes a graph re-runnable. Deleting a run’s outputs does not break the pipeline, because the pipeline refers to assets the operator chose, not to the artifacts of the previous execution.

JSON payload preview as a debugging primitive

Every node can display the exact request body it will send before it runs.

This is a small feature that removes a large class of bugs. Node-based generation fails in a specific way: a chain produces a wrong result, and the cause is that the prompt arriving at the third node is not the prompt the operator believes they typed, because an earlier node inserted text, or a different model expects a different parameter name, or a reference did not resolve. Debugging that by running the chain and inspecting the output is expensive, because each iteration costs a generation.

Showing the payload turns the pipeline into something inspectable before anything is billed. It also forces the internal model to be honest. The preview is generated from the same code path that builds the real request, so it cannot drift from what is actually sent, and any mismatch between what the interface implies and what the API receives becomes visible in the editor rather than in the result.

The prompt assistant

Iterating on a pipeline means editing prompts, and prompting is where most of the effort in this kind of tool actually goes. The assistant operates in place, rewriting the text of the node being edited rather than living in a separate chat pane. Suggestions arrive as a replacement for the current prompt, not as a paragraph to be copied across.

The assistant is given the node’s model and its reference assets as context, which is what keeps its output usable. A generic rewrite of a prompt is often worse than the original, because it does not know which model is receiving it or what the attached image already establishes. Having that context is the difference between an assistant that shortens editing and one that adds a second thing to correct.

Self-hosting, and the credit system that is not there

The stack is Next.js with React 19 for the interface, React Flow for the canvas, a Zustand store for graph state, Supabase for persistence, and S3-compatible storage for outputs. Model access is configured per deployment, so the operator supplies their own provider credentials.

There is no built-in credit system, and that absence is intentional. A credit system exists to meter something the platform resells. Nothing is resold here, so adding one would introduce a billing concept, a balance that can be exhausted, and a schema for tracking spend, all in service of a mechanism that the operator’s provider account already handles. Purchased generations belong to the operator’s own account, which is the property a hosted builder cannot offer.

The same reasoning applies to shared pipelines. A graph can be published as a read-only view, which makes the pipeline inspectable without making it editable and without granting execution rights. Sharing an artifact is useful; sharing an account is not.

What was hard, and what I would do differently

Graph validation is the part that is easy to skip and expensive to omit. Injecting a node into an existing edge, connecting two nodes into a cycle, deleting a node that three others depend on, each of those is a state that the canvas will happily represent and the executor cannot run. The executor has to be defensive about the graph it receives regardless of what the editor allowed, because the stored graph can be edited by an older client or constructed by hand.

The second difficulty is partial failure across parallel branches. Independent nodes can run concurrently, which is what makes a wide graph fast, but it also means several nodes can fail for different reasons in the same run. Reporting that clearly required the run to carry per-node outcome rather than a single run-level status, and the interface had to be built to show a mostly-successful run rather than a binary one. Designing the run record around per-node results from the beginning would have saved a rewrite of the status model.

Third, cost visibility is still thinner than it should be. A video node and an image node differ by orders of magnitude in price, and a graph that runs many of one is not comparable to a graph that runs many of the other. Estimating per-node cost before a run, from the model and the parameters, would make the tool honest about what an execution is about to spend, instead of leaving it as something discovered afterwards on a provider invoice.

References

  1. [Author]Aryan (Uo1428)

Built with

Next.jsReact 19React FlowSupabaseS3Zustand

Related production systems from the same category.

All case studies →

Want this kind of system on your side of the table?