2023-12-09 19:32:58 -08:00
2023-12-09 17:54:53 -08:00
2023-12-09 14:29:24 -08:00
2023-12-08 15:53:59 -08:00
2023-12-09 14:27:11 -08:00
2023-12-06 14:49:02 -08:00
WIP
2023-12-04 12:22:19 -08:00
2023-12-04 13:57:55 -08:00
2023-12-04 12:18:35 -08:00
2023-12-09 19:32:58 -08:00
hmm
2023-12-04 13:03:45 -08:00

ComfyUI-Keyframed

🚧 Work In Progress 🚧 - ComfyUI nodes to facilitate value keyframing by providing an interface for using keyframed in ComfyUI workflows.

Similar project you might find more convenient for certain use cases https://github.com/FizzleDorf/ComfyUI_FizzNodes

Overview

Philosophy

  • Treat curves/schedules and keyframes as objects that can be passed around, plugged and unplugged, interchanged, and manipulated atomically.
  • Leverage nodes to facilitate modularity and flexibility.
  • Facilitate fast iteration
  • Provide convenience functions for most common use cases, and also low-leverl operators capable of reproducing the behavior of those convenience functions to permit user customization in "node space".

Starter Workflows

Prompt Scheduling

Prompt Scheduling

This one is probably why you are here. This workflow demonstrates how to use the keyframed/schedule nodes to achieve similar behavior as FizzNodes' PromptSchedule node, but implemented differently.

This schedule is essentailly a normal AnimateDiff workflow where several nodes have replaced the normal conditioning setup. Rather than a single CLIP Text Encode node, we can have multiple prompts which transition sequentially over time. For documentation detailing how this workflow works, see the Nodes > Scheduling section below.

Prompt Interleaving (aka Prompt Entanglement, aka Prompt Superposition)

Prompt Entanglement

Which is the node equivalent for achieving this type of thing

Simple Curved Parameter

Simple Curved Parameter

Multi-Prompt Transition With Manually Specified Curves

Manual Prompt Transition

Nodes

Curve Constructors

Curve From String

Curve From String

Curve From YAML

Curve From YAML

Constant-Valued Curve

Curve From YAML

Entangled Curves

Entangled Curves

Each output curve of the node is a sine wave that oscillates from 0 to 1 at the given frequency or wavelength. The outputs of a given node are phase-offset such that at any given time, the sum of the generated curves is 1.

Reference the Prompt Interleaving Workflow for a demonstrative example.

Curve Operators

Evaluate Curve At T

Evaluate Curve At T

Apply Curve To Conditioning

Apply Curve To Conditioning

Add Conditions

Apply Curve To Conditioning

Curve Arithmetic Operators

Curve Arithmetic

NB: the division operator is unreliable at the time of this writing (2023-12-09).

Scheduling

These nodes work together to facilitate transitioning through a sequence of conditionings (i.e. prompts). We'll call this sequence the "schedule" of the conditionings. The primary use case here is for manipulating the positive prompt, i.e. for building a "prompt schedule". Given a particular time (e.g. frame id) in an animation seuquence, we can query the prompt schedule at that time to get the appropriate conditioning to pass to the KSampler.

Reference the Prompt Scheduling Workflow for a demonstrative example

Keyframed Condition

Keyframed Condition

This node attaches a conditioning to a keyframe. This let's us assign a time to the conditioning and set what interpolation method to use when we're between keyframes.

Interpolation Methods

Consider three time points a,b,c such that a<b<c, and two keyframes X,Y such that X.time = a and Y.time = c. To interpolate a value at time b, we would use X.interpolation_method to "tween" the value between X.value and Y.value.

  • null - If the interpolation value is not set, the default interpolation is "previous".
  • previous - X.time
  • next - Y.time
  • linear - normal linear lerp. Matches the behavior of Deforum and FizzNodes.
  • sine_wave - sine function easing. slower close to terminal values, fastest at the middle of the transition.
  • `eased_lerp - sin2 easing. similar to sine but starts and ends slower and the fastest part is faster.
  • exp_decay - starts fast ends slow.

Set Keyframe

Set Keyframe

Evaluate Schedule

Evaluate Schedule

S
Description
No description provided
Readme MIT
9.2 MiB
Languages
Python 100%