Media Generation Nodes

Applies to: ChengOS v0.2.0+ | Last verified: 2026-09-25 | Source: crates/cheng-nodes/src/nodes/builtin/ai/media_generation, crates/cheng-nodes/src/nodes/builtin/tools/media_generation

Image, video, and audio generation each get a node. They are thin fronts over a provider call: you supply a prompt and the provider-specific options, and you get an artifact back rather than inline bytes. Model and provider selection follows the same configuration path as the LLM nodes, so a workflow that already has a configured provider does not need a second set of credentials.

Generate Image Tool — tools/generate_image

Agent tool: generate an image from a text prompt; returns workspace artifact references. Configure the provider connection (llm_config) on the canvas.

Inputs

FieldTypeRequiredDefaultDescription
promptstring (port)—""Text prompt describing the image to generate. Connection port, not a form field. Control: textarea
llm_configobject (port)—nullProvider connection config (from ai/llm_config or JSON). Connection port, not a form field. Control: text
sizestring—nullImage size, e.g. 1024x1024 (provider-defined values). Control: select
aspect_ratiostring—nullAspect ratio, e.g. 16:9 (providers that take ratios instead of sizes). Control: select
qualitystring—nullProvider-defined quality tier, e.g. standard / hd
stylestring—nullProvider-defined style, e.g. vivid / natural
countinteger—nullNumber of images to generate (default 1). Control: number
output_filenamestring—nullOutput filename; extension is corrected to match the actual format
contentarray<any> (port)—nullNon-text multimodal inputs as a JSON array, e.g. [{"type":"image_url","url":"https://…","role":"source_image"}]; text belongs in prompt. Connection port, not a form field. Control: json
source_imagestring—nullImage to transform (image-to-image / editing): an https URL, an artifact:// URI, or a data: URI. Providers differ in how much of the original they keep; strength-style controls belong in provider_options
source_image_artifactobject (port)—nullImage to transform; connect from an upstream .artifact port. Connection port, not a form field.
mask_imagestring—nullInpainting mask over the source image; provider support is narrow — OpenAI wants a same-size RGBA PNG whose transparent pixels are the region to repaint
provider_optionsobject (port)—nullProvider-specific options JSON merged into the request body. Connection port, not a form field. Control: json

Outputs

FieldTypeDescription
artifactobject (port)Generated image artifact reference (primary output). Connection port, not a form field.
artifactsarray<object> (port)All generated image artifact references. Connection port, not a form field.
urlstringartifact:// URI of the first image (compatibility only)
statusstringFinal status: completed / failed / timeout
errorstringError message when generation failed
metadataanyDiagnostic metadata (job id, attempts, elapsed ms, provider extras)

Generate Video Tool — tools/generate_video

Agent tool: generate a video from a text prompt (async submit/poll); returns a workspace artifact reference. Configure the provider connection (llm_config) on the canvas.

Inputs

FieldTypeRequiredDefaultDescription
promptstring (port)—""Text prompt describing the video to generate. Connection port, not a form field. Control: textarea
llm_configobject (port)—nullProvider connection config (from ai/llm_config or JSON). Connection port, not a form field. Control: text
durationinteger—nullVideo duration in seconds (provider-defined values). Control: number
resolutionstring—nullVideo resolution, e.g. 1080P / 720P (provider-defined). Control: select
aspect_ratiostring—nullAspect ratio, e.g. 16:9 (providers that support it). Control: select
seedinteger—nullDeterministic seed when the provider supports it. Control: number
poll_timeout_secsinteger—nullMax seconds to poll the async job before giving up (default 600). Control: number
poll_interval_secsinteger—nullSeconds between job status polls (default 5). Control: number
output_filenamestring—nullOutput filename; extension is corrected to match the actual format
contentarray<any> (port)—nullNon-text multimodal inputs as a JSON array, e.g. [{"type":"image_url","url":"https://…","role":"first_frame"}]; text belongs in prompt. Connection port, not a form field. Control: json
first_frame_imagestring—nullFirst-frame image URL: an https URL, an artifact:// URI, or a data: URI
last_frame_imagestring—nullLast-frame image URL: an https URL, an artifact:// URI, or a data: URI
first_frame_artifactobject (port)—nullFirst-frame image artifact; connect from ai/image_generation.artifact. Connection port, not a form field.
last_frame_artifactobject (port)—nullLast-frame image artifact; connect from ai/image_generation.artifact. Connection port, not a form field.
provider_optionsobject (port)—nullProvider-specific options JSON merged into the request body. Connection port, not a form field. Control: json

Outputs

FieldTypeDescription
artifactobject (port)Generated video artifact reference (primary output). Connection port, not a form field.
poster_artifactobject (port)Poster/cover image artifact when the provider returns one. Connection port, not a form field.
statusstringFinal status: completed / failed / timeout / invalid_input
errorstringError message when generation failed
metadataanyDiagnostic metadata: provider job id, poll attempts, elapsed ms

Generate Audio Tool — tools/generate_audio

Agent tool: synthesize speech (TTS) from text; returns a workspace artifact reference. Configure the provider connection (llm_config) on the canvas.

Inputs

FieldTypeRequiredDefaultDescription
textstring (port)—""Text to synthesize into speech. Connection port, not a form field. Control: textarea
llm_configobject (port)—nullProvider connection config (from ai/llm_config or JSON). Connection port, not a form field. Control: text
voicestring—nullTTS voice id, e.g. alloy / nova (provider-defined)
formatstring—nullAudio output format, e.g. mp3 / wav / opus
speednumber—nullTTS speed multiplier (e.g. 0.5 - 2.0). Control: number
output_filenamestring—nullOutput filename; extension is corrected to match the actual format
provider_optionsobject (port)—nullProvider-specific options JSON merged into the request body. Connection port, not a form field. Control: json

Outputs

FieldTypeDescription
artifactobject (port)Generated audio artifact reference (primary output). Connection port, not a form field.
statusstringFinal status: completed / failed / timeout
errorstringError message when generation failed
metadataanyDiagnostic metadata (elapsed ms, provider extras)

Next steps