Nodes/Deforum Nodes/(deforum) Hybrid Parameters
ComfyUI Node

(deforum) Hybrid Parameters

The settings that fuse your video into the animation

By XmYx·Created 3 years ago·Updated 4 months ago· 198
(deforum) Hybrid Parameters
  • deforum_data
  • deforum_data
hybrid_use_first_frame_as_init_imagetrue
hybrid_motion
hybrid_motion_use_prev_imgfalse
hybrid_flow_consistencyfalse
hybrid_consistency_blur2
hybrid_flow_method
hybrid_composite

Hybrid mode is Deforum's answer to "how do I make my animation actually follow a video?" Instead of a purely synthetic camera move, you feed the loop a real video and the animation adapts to it - its frames become init images, its optical flow becomes motion, its colors get borrowed. This node is the config block for all of that: the toggles and dropdowns that decide how the reference video gets fused into your run. It's a parameter node, so it writes into the shared deforum_data dict and passes it on - no image processing happens here.

The settings that matter

  • hybrid_use_first_frame_as_init_image - uses the reference video's first frame as the animation's starting point. Keep it on for a proper vid2vid feel; turn it off if you'd rather the animation start from your own prompt's image.
  • hybrid_motion - the big one. None (no borrowed motion), Optical Flow (warp your frames along the video's flow - what Hybrid Motion node implements), Perspective, or Affine. Optical Flow is the modern workhorse; Perspective and Affine are the cheaper, older approximations from the original Deforum.
  • hybrid_motion_use_prev_img - whether motion is computed against the video's previous frame or your generated previous frame. Subtle, rarely touched, but it changes the feel.
  • hybrid_flow_consistency and hybrid_consistency_blur - an experimental flow-stabilization toggle plus its blur radius (default 2). Leave both alone until you're chasing flicker.
  • hybrid_flow_method - which estimator computes the flow: RAFT (accurate, model-backed), DIS Medium, DIS Fine, or Farneback (fast, rough). Same family as the Hybrid Motion node's method.
  • hybrid_composite - when to composite the video over your output: None, Normal, Before Motion, or After Generation. If you want the video's own pixels to peek through (style-transfer mode), this is where you say so.

Output is deforum_data, chained into the rest of the parameter blocks.

How it fits

The classic setup reads like a pipeline you can picture: Load VideoHybrid Parameters → the sampler, with Hybrid Motion warping in the image path and Hybrid Schedule controlling the flow strength over time. These three nodes plus the video loader are the whole hybrid subsystem, and this one is the control panel.

Installation

Same as every node in the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/deforum-comfy-nodes.git

Restart, or search "Deforum Nodes" by XmYx in ComfyUI Manager. Hybrid actually exercises the heavy parts of the install - deforum[comfy] backend, opencv-contrib, the flow models - plus Python 3.10 as the README demands, so expect the first real hybrid run to take a while as weights download.

Gotchas

  • "I enabled Optical Flow and nothing moved" - check that a Hybrid Motion node is actually in the image path. This node only writes settings; something else has to consume them.
  • Flow tearing - when borrowed motion is too aggressive, lower the flow factor in Hybrid Schedule before you blame this node.
  • The commented-out options - the source has a whole layer of hybrid compositing settings (mask types, alpha schedules) commented out. If you see tutorial references to hybrid masks and can't find them here, they were trimmed in this fork.
Categorydeforum/parameters

Inputs (8)

NameTypeDefaultDescription
hybrid_use_first_frame_as_init_imageBOOLEANtrue
hybrid_motionCOMBO4 options: None, Optical Flow, Perspective, Affine
hybrid_motion_use_prev_imgBOOLEANfalse
hybrid_flow_consistencyBOOLEANfalse
hybrid_consistency_blurINT2
hybrid_flow_methodCOMBO4 options: RAFT, DIS Medium, DIS Fine, Farneback
hybrid_compositeCOMBO4 options: None, Normal, Before Motion, After Generation
deforum_dataoptdeforum_data

Outputs (1)

NameTypeDescription
deforum_datadeforum_data