Nodes/AnimoFlow/priorMDM Generate (AnimoFlow)
ComfyUI Node

priorMDM Generate (AnimoFlow)

When the text isn't enough and you draw the path

By AnimoFlow·Created 2 months ago·Updated about a month ago· 1
priorMDM Generate (AnimoFlow)
    • npz_b64
    • native_fps
    prompta person walks forward
    sample_id000004
    num_frames196
    cfg2.5
    seed42
    curve_2d_json
    accel_frac0.25
    decel_frac0.25

    Plain MDM gives you a prompt and a prayer about where the character actually goes. AnimoFlow_PriorMDM fixes that: it's MDM's trajectory-conditioned sibling, which lets you hand the model a 2D ground-plane path - draw a curve, the character follows it. That one addition turns text-to-motion from a slot machine into something you can actually direct. It's the difference between "a person runs in a random direction" and "a person runs a circle around the pillar."

    Same architecture as the other generators: an HTTP client that posts to the priorMDM container on localhost:8002 and polls /progress/{job_id} for the resulting NPZ. The trajectory isn't a hard constraint - it's a prior. The model starts from the text prompt and your drawn curve biases the root's path through a root-inpainting scheme, so you get motion that follows the curve without looking like the character is stuck on rails. That's also why you can't just pick any curve: it has to be a path a human could plausibly walk, and it's normalized to a canonical frame before it goes in.

    Inputs that matter

    • prompt - multiline English, HumanML3D style, same as MDM.
    • sample_id - default "000004", a string, and the oddest input on the node. priorMDM keeps a handful of pre-computed trajectory samples; this selects which one seeds the run. Leave it unless you know what you're doing.
    • num_frames - 16–196, default 196. More than MDM's 120 - priorMDM was built to run longer sequences.
    • cfg - default 2.5, much lower than MDM's 7.5. The trajectory is doing a lot of the conditioning work, so the text guidance doesn't need to scream.
    • curve_2d_json - the optional input where the trajectory lands. Wire it from AnimoFlow_DrawTrajectory's curve_2d_json output (the curated trajectory_priormdm workflow does exactly this). It's a canonicalized 2D polyline, not raw pixels.
    • accel_frac / decel_frac - both default 0.25. What fraction of the trajectory the character spends accelerating out of and decelerating into its motion. Bump these up if the character starts or stops unnaturally abruptly.
    • seed - default 42.

    Outputs and where they go

    npz_b64 and native_fps (20, like MDM). From here it's the standard chain - AnimoFlow_Resample to 30 fps, AnimoFlow_IK to BVH, AnimoFlow_Rig onto a character, AnimoFlow_GLBExport, preview. The important wiring detail: AnimoFlow_DrawTrajectory also emits a traj_restore_json that feeds AnimoFlow_GLBExport, so the final export places your character back on the exact curve you drew. Generation happens in the model's canonical frame, and the export stage puts it back on your drawing - draw anywhere, it lands where you drew.

    Install and troubleshooting

    The priorMDM weights are baked into the container image at build time, so the backend install is just:

    cd comfyui-animoflow
    ./install.sh doctor
    ./install.sh up
    

    First boot loads the trajectory + timeline checkpoints (around 2 GB) and can take a couple of minutes to become healthy - the README calls out ~2 min for priorMDM's startup specifically, and it's slower than the health-check window, so a container sitting in starting is expected, not stuck. ./install.sh status is the honest check: it reports whether weights are actually loaded per container. If the node errors "container unreachable at http://localhost:8002", either the backend isn't up or your PRIORMDM_ENDPOINT env var points somewhere else. And the Nodes 2.0 interactive-node shrinking bug does affect the draw pad you'd use with this node - more on that in the AnimoFlow_DrawTrajectory article, but the workaround is just to enlarge the node manually.

    CategoryAnimoFlow/Motion

    Inputs (8)

    NameTypeDefaultDescription
    promptSTRINGa person walks forward
    sample_idSTRING000004
    num_framesINT19616–196
    cfgFLOAT2.50–10
    seedINT420–2147483647
    curve_2d_jsonoptSTRING
    accel_fracoptFLOAT0.250–1
    decel_fracoptFLOAT0.250–1

    Outputs (2)

    NameTypeDescription
    npz_b64ANIMOFLOW_NPZ
    native_fpsINT