Self-host image and video generation with Workers AI
Run Prints on Oyster, choose models and references, save results on a Computer, and recover a failed save without generating again.
Prints turns a prompt into an image or video and keeps it in a gallery folder on your Computer. On Oyster, the App runs on your own Cloudflare account, uses Workers AI and saves files to the Computer’s Linux workspace in a Cloudflare Container.
Self-hosting the App does not make model inference local or free. Generation needs a configured model, permission to use it and funding. Some models route through Cloudflare AI Gateway.
Install Prints on Oyster
Section titled “Install Prints on Oyster”First deploy your own Oyster. The Computer uses Containers, so this deployment needs Workers Paid. On a deployed Oyster, install the starter Apps:
export OYSTER_URL=https://oyster.<your-subdomain>.workers.devexport OYSTER_OWNER_KEY=<your owner key>npx oyster install-appsThe installer clones, builds and installs all seven starter Apps; it is not a
Prints-only install. Sign in at $OYSTER_URL/login with the owner key and open
Prints from Tourtois. Rerunning install-apps updates the Apps while keeping
their data.
Do not put the owner key in a public page or client-side code. Agent and App access remain governed by the host’s permissions.
Choose a folder, model and prompt
Section titled “Choose a folder, model and prompt”- Open Prints and choose the Computer and gallery folder you want to use. Uploads and generated files appear in that folder.
- Type a prompt, then pick a model and its available size and settings.
- Add style-reference images if the selected model accepts them. Reference limits and supported settings come from the model catalog.
- Submit the generation and follow its tile or Activity in the status bar. Open a finished image’s Image info panel with I, download it, or open the picture in Inkcap.
Images keep the model’s native format: PNG where supported, JPEG otherwise. Video output is MP4. A download removes prompt and lineage metadata while keeping the AI marker and print ID; the file on the Computer stays unchanged.
An empty model list or disabled action needs attention to model access and funding. A catalog price estimate describes its stated default settings; it is not the final charge for every prompt, size or reference set.
For the Team-hosted path, including folder creation and media approval, see Make and save images. Oyster and Fungi Hub have different admission and billing paths.
Generate video through AI Gateway
Section titled “Generate video through AI Gateway”Oyster’s agent quick start lists the routed video model IDs:
bytedance/seedance-2.0bytedance/seedance-2.0-fastbytedance/seedance-2.0-minigoogle/veo-3.1google/veo-3.1-fastminimax/h3-max
Prints uses the account’s default AI Gateway, created automatically; set
AI_GATEWAY_ID to use another. Model availability and funding still need to be
configured. If a refusal carries provider.reason: "credits_exhausted", check
AI Gateway credits and billing in Cloudflare. It is not the same as a
Team-credit refusal. Do not repeat a result marked retryable: false.
For agent callers, listModels reports models, sizes, settings and reference
limits. generateVideo can return { kind: "pending", retryAfterMs }; call
again with the same inputs after that delay, rather than starting a second
generation.
Retry a save without regenerating
Section titled “Retry a save without regenerating”Every generation carries a stable request ID. Repeating that ID and the same inputs recovers the same generation rather than paying for another. The Prints UI’s retry resumes the attempt; Resume picks up unfinished image work after a reload.
Darkroom owns the durable generation underneath. It captures identity and input, retains provider bytes before the destination save, and reuses those bytes after a failed save. An ambiguous provider execution is never silently dispatched again. Do not change the request ID just to recover a failed destination write.
Store generated images in R2 from a Durable Object
Section titled “Store generated images in R2 from a Durable Object”If you are building a media host rather than using Prints, Darkroom’s
@fungi.computer/darkroom/cloudflare adapter combines SQLite Durable Objects
and R2. Its quick start exports MediaOperationDO, binds MEDIA_OPERATION and
uses APP_ARTIFACTS for retained output. The host supplies a provider and an
authorized destination; the example destination writes the completed file with
env.OUTPUTS.put(path, bytes) to a separate output bucket.
These are different responsibilities: retained bytes make save recovery possible; the destination is where the user asked to keep the result. Darkroom does not choose the caller’s identity, permissions, provider or destination policy. Its local quick start uses a fixed one-pixel image, not a real model call.
- Darkroom for the R2/SQLite setup, HTTP request IDs, metering and recovery contract.
- Prints README for the App’s methods, generation settings and reference-file permissions.