Skip to main content

DreamLayer CLI

What this lets you do

Run DreamLayer against files on your machine without writing an integration. The CLI reads local images, streams progress into your terminal, and writes finished PNGs back to disk, so it composes with the tools you already use.

What you need

  • Node.js 22.12 or later. If you do not have it: brew install node on macOS, or the installer at nodejs.org
  • A DreamLayer API key with credits

Steps

1. Install

2. Give it the key

The CLI reads the key from the environment. The same key works in your shell, in a build, and inside the MCP server, so there is one credential and one balance to track.

3. Generate

4. Edit from a reference image

5. Cut out the background

The result is a PNG with a real alpha channel, so it composites onto any background. Translucent subjects stay translucent: glass, smoke and hair keep their partial transparency rather than being forced solid.

6. Upscale

Each side doubles. The input’s longest side must be 2048 or smaller, because 4096 is the delivery ceiling; an oversize request is refused before any provider is paid, not after. An upscaled image is therefore already at the maximum input dimension and cannot be upscaled a second time. Upscaling is the slowest operation, typically two to three minutes. The CLI waits as long as the server keeps the connection alive and only gives up if the stream goes silent, so a slow job is not mistaken for a dead one.

7. Check your balance without spending

This reports promotional, purchased, and total available credits for the API key in DREAMLAYER_API_KEY. It calls no image service, costs nothing, and does not expose an account selector.

8. Check capabilities without spending

This reports the protocol version, your key mode, and the operations your key can actually run. It calls no provider and costs nothing, which makes it the right first command after installing.

Confirm it worked

The command exits 0, the output file exists and opens as a PNG, and the Usage page in the console shows one settled credit.

Common errors

Troubleshooting

Every command accepts --json for machine-readable output. Error output carries only the stable public contract and excludes prompts, images, local filenames, and your key. Successful image output includes the destination path you selected, so remove that path before sharing it if the local name is private.

Next steps