dreamlayer

v0.4.0-beta.5
io.github.TheDesignFounder/dreamlayer Checked 4 days ago Published 2 months ago

Generate and edit images, remove backgrounds, upscale, and create sprite sheets through DreamLayer.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

dreamlayer_capabilities

Use before choosing an image operation or quoting a sprite job. Read supported operations, input limits and sprite_pricing for this API key, including plain_frame_cents for sprites that keep their background. Returns the current API contract; no image input, generation or credits required. Do not use this to create an asset.

dreamlayer_balance

Use before paid image work to check available credits for this API key. Returns promotional, purchased, available and credit_usd. Compare the complete rounded quote against available; separately rounded buckets may sum to 0.1 less. Costs no credits and does not buy credits. Resolve authentication or balance errors before generation.

dreamlayer_upload_image

Use when an edit, background removal, upscale or sprite animation needs a local reference. Requires an absolute path to PNG, JPEG, WebP or supported camera RAW, up to 200 MB. Uploads that file and returns input_asset_id; starts no paid work. Reuse the asset ID for recovery. Not needed for text-to-image. If upload fails, fix the input or retry upload only.

ParameterTypeDescription
path *stringAbsolute path to a PNG, JPEG, WEBP, or camera RAW.

dreamlayer_generate

Use when the user needs an original image, raster logo concept, product or marketing visual, an edit, transparent cutout, upscale, or reference-based sprite animation. Starts paid work within the user's authorized scope and budget. Text-to-image needs a prompt; other operations need input_asset_id. Select operation explicitly. Image operations cost one credit; sprite beta accepts 7–100 frames and returns a ZIP, transparent unless options.background is keep. Read sprite_pricing, quote a transparent sheet from first_tier_cents and additional_frame_cents and a kept-background sheet from the fla…

ParameterTypeDescription
aspect_ratiostringOutput aspect ratio (default 1:1).
conversation_idstringUUID of an existing conversation to continue, as returned by an earlier dreamlayer_generate call. Required with respond; omit to start a new conversation.
idempotency_keystringChoose and save one key per logical request before calling. Reuse that key AND identical arguments after an uncertain response. If omitted, a generated key is returned for recovery.
input_asset_idstringFrom dreamlayer_upload_image. Required for every operation except text_to_image.
max_creditsnumberSpending cap for this request in credits (0.1–100, default 1). Image operations require exactly 1. Sprite jobs must be capped at or above the sprite_pricing quote rounded up to one decimal.
operationstringName it to run deterministically and skip interpretation, so the request cannot come back as a question. Omit it to let DreamLayer read the prompt.
optionsobjectSprites: supply exactly one of action (legacy preset) or animation_prompt (any subject/action, including turntables). animation_mode defaults to loop for presets, once for custom prompts. Broad reques…
promptstringWhat to generate, or how to change the reference, in plain language (1–4000 characters). Required unless respond is used; text_to_image needs it, and a short statement of intent is enough for backgr…
respondstringAnswer a previous question. Requires conversation_id.

dreamlayer_execution

Use after a timeout, rate limit or uncertain result to read the existing execution's canonical status. Requires execution_id; costs no credits. Returns state and result details, not a newly generated image. If running, wait and resume events; if completed, download. Do not replace an uncertain paid job.

ParameterTypeDescription
execution_id *stringUUID of the execution, as returned by dreamlayer_generate.

dreamlayer_events

Use to resume running work or a dropped stream without another generation charge. Requires execution_id; pass the last_event_id actually processed. Returns bounded events, status and recovery cursor. If still running or rate-limited, back off before polling again. Do not repeatedly call in a tight loop or submit replacement work.

ParameterTypeDescription
execution_id *stringUUID of the execution, as returned by dreamlayer_generate.
last_event_idstringId of the last event you processed; events after it are returned. Omit to replay from the start.

dreamlayer_download

Use when an existing execution completed or a previous download failed. Requires execution_id and an absolute new local path. Saves the finished image or sprite ZIP and returns path/bytes; starts no generation and spends no new credits. Never overwrites. For output_not_ready check status; for local_output_failed repair the path and download the same execution.

ParameterTypeDescription
execution_id *stringUUID of a completed execution, as returned by dreamlayer_generate.
path *stringAbsolute destination path; an existing file is never overwritten.