diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..1c3665f --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,20 @@ +# https://github.com/ekalinin/github-markdown-toc/blob/master/README.md#toc-generation-with-github-actions + +on: + push: + branches: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v2 + - run: | + curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/0.8.0/gh-md-toc -o gh-md-toc + chmod a+x gh-md-toc + ./gh-md-toc --insert --no-backup --hide-footer README.md + rm gh-md-toc + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Auto update markdown TOC diff --git a/README.md b/README.md index b1fb76c..9e16490 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,54 @@ 🚧 Work In Progress 🚧 - ComfyUI nodes to facilitate value keyframing by providing an interface for using [keyframed](https://github.com/dmarx/keyframed) in ComfyUI workflows. +Similar project you might find more convenient for certain use cases https://github.com/FizzleDorf/ComfyUI_FizzNodes -...Open question: if I make this, what will differentiate it from https://github.com/FizzleDorf/ComfyUI_FizzNodes ? + +* [ComfyUI-Keyframed](#comfyui-keyframed) +* [Overview](#overview) +* [Starter Workflows](#starter-workflows) + * [Prompt Scheduling](#prompt-scheduling) + * [Prompt Interleaving (aka Prompt Entanglement, aka Prompt Superposition)](#prompt-interleaving-aka-prompt-entanglement-aka-prompt-superposition) + * [Simple Curved Parameter](#simple-curved-parameter) + * [Multi-Prompt Transition With Manually Specified Curves](#multi-prompt-transition-with-manually-specified-curves) +* [Nodes](#nodes) + * [Curve Constructors](#curve-constructors) + * [Curve From String](#curve-from-string) + * [Curve From YAML](#curve-from-yaml) + * [Constant-Valued Curve](#constant-valued-curve) + * [Entangled Curves](#entangled-curves) + * [Curve Operators](#curve-operators) + * [Evaluate Curve At T](#evaluate-curve-at-t) + * [Apply Curve To Conditioning](#apply-curve-to-conditioning) + * [Add Conditions](#add-conditions) + * [Curve Arithmetic Operators](#curve-arithmetic-operators) + * [Scheduling](#scheduling) + * [Keyframed Condition](#keyframed-condition) + * [Interpolation Methods](#interpolation-methods) + * [Set Keyframe](#set-keyframe) + * [Evaluate Schedule](#evaluate-schedule) + -* easier curve composition -* easier to change interpolators/easing functions -# Philosophy +# 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". -Treat curves/schedules and keyframes as objects that can be passed around, plugged and unplugged, interchanged, and manipulated atomically. # Starter Workflows - ## Prompt Scheduling ![Prompt Scheduling](examples/prompt-scheduling.png) + This one is probably why you are here. This workflow demonstrates how to use the `keyframed/schedule` nodes to achieve similar behavior as [FizzNodes'](https://github.com/FizzleDorf/ComfyUI_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`](https://github.com/dmarx/ComfyUI-Keyframed/blob/dev/README.md#scheduling) section below. ## Prompt Interleaving (aka Prompt Entanglement, aka Prompt Superposition) @@ -62,6 +93,9 @@ Which is the node equivalent for achieving this type of thing ![Entangled Curves](assets/nodes_entangled.png) +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](https://github.com/dmarx/ComfyUI-Keyframed/blob/dev/README.md#prompt-interleaving-aka-prompt-entanglement-aka-prompt-superposition) for a demonstrative example. ## Curve Operators @@ -89,16 +123,37 @@ 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](https://github.com/dmarx/ComfyUI-Keyframed/tree/dev?tab=readme-ov-file#prompt-scheduling) for a demonstrative example + ### Keyframed Condition ![Keyframed Condition](assets/node_keyframed-condition.png) +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