ComfyUI Node

AM Write Video

A ComfyUI node in AM VFX Tools with 31 inputs and 9 outputs.

By am-pipeline-prod·Created 4 months ago·Updated 2 months ago· 3
AM Write Video
  • image
  • mask
  • audio
  • video
  • image
  • mask
  • resolved_path
  • info
  • width
  • height
  • frame_rate
  • frame_count
  • video
file_path
extmov
seed-1
use_batchfalse
frame_modeall
frame_rate25.00
first_frame1
last_frame-1
codecmov/prores
codec_profileprores/422
pixel_format
bitrate_or_crf
gop_size0
working_colorspaceDisplay/sRGB - Display
raw_datafalse
output_colorspaceDisplay/Gamma 2.2 Rec.709 - Display
embed_workflowtrue
reformat_modeoff
scale1.00
presetWidth/Height
target_width1920
target_height1080
resize_typefit
filtercubic
output_dtypefp16
show_previewtrue
load_saved_from_diskfalse
CategoryAM VFX Tools

Inputs (31)

NameTypeDefaultDescription
file_pathSTRINGAbsolute output container path. Use the 📂 Browse button for the native dialog.
extCOMBOmovContainer format. The codec dropdown below is filtered to codecs the chosen container natively pairs with.
seedINT-1-9223372036854776000–9223372036854776000Generation seed — metadata-only, never in the filename. -1 = look up the AM Seed registry by id(prompt). Any other value (typed or wired) wins over the registry.
use_batchBOOLEANfalseWhen On, append a runtime-discovered `_bNNNN` suffix (queue-iteration counter, scanned from the output dir). Off = no suffix; queue iterations overwrite each other.
frame_modeCOMBOallWhich input batch frames to encode. single = only `first_frame`. range = `first_frame`..`last_frame` inclusive. all = every frame in the input batch.
frame_rateFLOAT25.000.1–480Output container's encoded time base.
first_frameINT11–999999Input batch index (1-based) for single mode; lower bound for range mode. Ignored in all mode.
last_frameINT-1-1–999999Input batch upper bound (1-based, inclusive) for range mode. -1 = auto = batch length.
codecCOMBOmov/proresEncoding codec, prefixed by its canonical container (`mov/prores`, `mp4/h264`, ...). The container half is guidance — `validate_container_codec` permits other legal pairings if `ext` is set differently.
codec_profileCOMBOprores/422Codec profile, prefixed by the bare codec name (`prores/422`, `h264/main`). Must match the codec chosen above — mismatched prefix raises at execute time.
pixel_formatSTRINGOutput pixel format. Empty = (auto) per codec/profile. Override for specific subsampling / bit depth (e.g. `yuv422p10le` for 10-bit 4:2:2).
bitrate_or_crfSTRINGQuality / bitrate setting. Empty = codec default. h264/h265/vp9: `crf=18` (quality, lower=better) or `8M` / `500k` (bitrate). prores/dnxhr: bitrate only (CRF ignored).
gop_sizeINT00–6000 = codec default (typically 250 for h264/h265). Lower = more keyframes, larger files.
working_colorspaceCOMBODisplay/sRGB - DisplaySource colorspace — the space the upstream IMAGE tensor is in. The OCIO transform converts from this to `output_colorspace`.
raw_dataBOOLEANfalseWhen On, skip the OCIO transform — pixels encoded verbatim. `working_colorspace` and `output_colorspace` are ignored.
output_colorspaceCOMBODisplay/Gamma 2.2 Rec.709 - DisplayDestination colorspace. The OCIO transform converts to this, and the value is tagged into the encoded container metadata (default `Gamma 2.2 Rec.709 - Display` — the studio dailies standard, falling back to `Rec.1886 Rec.709 - Display` on OCIO configs without the gamma 2.2 display variant).
embed_workflowBOOLEANtrueEmbed the API graph (`comfyui/prompt`) as container metadata so the file is round-tripped via AM-Pipe drag-drop. Off = clean deliverable. Honors ComfyUI's global `--disable-metadata` flag.
reformat_modeCOMBOoffReformat mode. off = bypass, output matches input. scale = uniform scale by `scale` (other widgets ignored). to_box = resize/crop to a target W×H from `preset` or `target_width`/`target_height`.
scaleFLOAT1.000.01–16Uniform scale factor. Used when `reformat_mode=scale`; ignored otherwise. Output dimensions are round(input × scale).
presetCOMBOWidth/HeightNamed output format. Used when `reformat_mode=to_box`. `Width/Height` = use the `target_width` / `target_height` widgets below. Any other entry overrides those widgets with the preset's resolution.
target_widthINT19201–16384Target output width in pixels. Used when `reformat_mode=to_box` AND `preset=Width/Height`; ignored when a named preset is selected.
target_heightINT10801–16384Target output height in pixels. Used when `reformat_mode=to_box` AND `preset=Width/Height`; ignored when a named preset is selected.
resize_typeCOMBOfitHow input maps into the target box. Used when `reformat_mode=to_box`. width/height = scale uniformly to match that edge. fit = scale to fit inside the box (letterbox; black where the box exceeds the scaled image). fill = scale to cover the box (crops the overflow). distort = scale W and H independently to exactly match the box (changes aspect). none = no scale; place input centered in the box (crop if larger, pad if smaller). Cropped-away/padded regions are TRANSPARENT — RGB sources are promoted to RGBA with alpha=0 in the padded area so downstream compositing is clean.
filterCOMBOcubicPixel filter for resampling. impulse = nearest-neighbor (mask passes, exact pixel preservation). linear = bilinear (cheap, smooth). cubic = bicubic (default; the safe Nuke-equivalent). Lanczos4 = sharpest; for high-quality stills / final delivery. area = best for downscaling — anti-aliased mean pooling, softer but artifact-free.
output_dtypeCOMBOfp16Output tensor dtype. fp32 = ComfyUI default (4 bytes/sample). fp16 = half memory + half VRAM (2 bytes/sample). EXR-native precision; fits the [0,1] LDR + scene-linear range with headroom up to ~65504. Some downstream nodes assume fp32 — flip back to fp32 if you hit dtype errors.
show_previewBOOLEANtrueShow a thumbnail of the first encoded frame on the node.
load_saved_from_diskBOOLEANfalseOFF (default): encode upstream IMAGE batch to a video container. ON: skip the encode entirely, decode the existing container at the same path the Write would resolve, and apply the INVERSE OCIO transform to land back in `working_colorspace`. Upstream nodes feeding image/mask/audio are NOT evaluated when ON. IMAGE output is in `working_colorspace` in BOTH modes (the OCIO transform is scoped to the encoded container; downstream nodes always see working-cs). Honors `raw_data` (skips OCIO both ways).
imageoptIMAGEImage batch to encode.
maskoptMASKOptional alpha channel as MASK (N×H×W float in [0,1]). MASK CONVENTION (stock ComfyUI): mask = 1 - alpha white (1.0) = 'area to inpaint' (source was transparent) black (0.0) = 'keep' (source was opaque) empty mask = all zeros (source has no alpha = fully visible) This is the SD-inpainting convention every stock ComfyUI mask-using node expects (LoadImage, MaskComposite, SetLatentNoiseMask, ImpactPack mask pipeline, etc.). Drop-in compatible with all of them. If you want NUKE-STYLE natural alpha (mask = alpha, where 1.0 = opaque), wire a MaskInvert node between this socket and your downstream consumer. When wired, the file is encoded with alpha = 1 - mask. Mismatched mask dimensions are auto-resized (cubic) to match the image's H,W. When the input IMAGE is already 4-channel and a MASK is also wired, MASK overrides the embedded alpha. Codec-aware: only ProRes 4444 / 4444 XQ in our codec table actually encode the alpha channel into the container. Wiring a MASK into a non-alpha codec (h264 / h265 / vp9 / dnxhr / ProRes 422 etc.) logs a warning and drops the mask at the ENCODER boundary — but the mask still appears on the `mask` OUTPUT socket for downstream use.
audiooptAUDIOAudio track to mux into the container. Optional.
videooptVIDEOOptional VIDEO input. When wired, calls `video.save_to(path)` — packet-copy when source codec matches dest (no decode), PyAV transcode otherwise. Either way no IMAGE batch is materialised. Upstream image/mask/audio are lazy-skipped. OCIO/Reformat don't apply — the video is written as-is. `VideoFromComponents` sources only support MP4+H264 output.

Outputs (9)

NameTypeDescription
imageIMAGESliced IMAGE passthrough — the input image post-frame-slice / post-mask-fold / post-reformat, in `working_colorspace`. The OCIO transform is scoped to the encoded container only; downstream nodes see the same colorspace as the upstream chain. RGB only.
maskMASKMASK passthrough — the alpha that was written to disk (or would have been, if the codec supports alpha). MASK CONVENTION (stock ComfyUI): mask = 1 - alpha white (1.0) = 'area to inpaint' (source was transparent) black (0.0) = 'keep' (source was opaque) empty mask = all zeros (source has no alpha = fully visible) This is the SD-inpainting convention every stock ComfyUI mask-using node expects (LoadImage, MaskComposite, SetLatentNoiseMask, ImpactPack mask pipeline, etc.). Drop-in compatible with all of them. If you want NUKE-STYLE natural alpha (mask = alpha, where 1.0 = opaque), wire a MaskInvert node between this socket and your downstream consumer. Sources, in priority order: 1. The wired `mask` input (if any). 2. Embedded alpha from a 4-channel IMAGE input. 3. Empty mask (zeros) — input was 3-channel with no MASK wired. Sized + reformatted to match the IMAGE output. Useful when chaining another node after a Write without re-reading from disk.
resolved_pathSTRINGAbsolute path of the written container.
infoSTRINGHuman-readable summary: dimensions, codec/profile, fps, frame count.
widthINTEncoded frame width in pixels.
heightINTEncoded frame height in pixels.
frame_rateFLOATContainer's encoded frame rate (the value used by the encoder).
frame_countINTNumber of frames encoded into the container.
videoVIDEOVIDEO passthrough — the same VIDEO that was written, available downstream without re-reading from disk. When the IMAGE branch fired, emits a `VideoFromComponents` wrapping the IMAGE batch + frame_rate. When the VIDEO branch fired, emits the input VIDEO as-is. None on no-op.