Scheduled prompts, scheduled float/int values and wave function nodes for animations and utility. compatable with https://www.framesync.xyz/ and https://www.chigozie.co.uk/keyframe-string-generator/ for audio synced animations in Comfyui.
Example: still in the oven
-
1.0 Installation
-
3.0 Scheduled Nodes
-
3.2 Promptschedule
-
3.3 ValueSchedule
-
4.0 Wave Nodes
-
5.0 Helpful Tools
-
6.0 Acknowledgements
For the easiest install experience, install the Comfyui Manager and use that to automate the installation process. Otherwise, to manually install, simply clone the repo into the custom_nodes directory with this command:
git clone https://github.com/FizzleDorf/ComfyUI_FizzNodes.git
and install the requirements using:
.\python_embed\python.exe -s -m pip install -r requirements.txt
If you are using a venv, make sure you have it activated before installation and use:
pip install -r requirements.txt
Example | Instructions |
---|---|
The nodes will can be accessed in the FizzNodes section of the node menu. You can also use the node search to find the nodes you are looking for. |
TODO:
- fix runoff past last keyframe
- add prepend/append inputs for prompt schedule
- prompt weight variables
- create readme
- Node flow method (there is an implementation although a bit annoying to convert inputs. I'll check this once that's sorted)
- workflow examples
- video examples
- Gligen support
- growable array of prompt weights
- attempt simplified scheduler node (another alternative)
- add more to this list
Instructions | Example |
---|---|
All of these nodes require the primitive nodes incremental output in the current_frame input. To set this up, simply right click on the node and convert current_frame to an input. Then, double click the input to add a primitive node. Set the node value control to increment and the value to 0. The primitive should look like this: | |
The text inputs pre_text and app_text are for appending or prepending text to every scheduled prompt. The primitive that is made from double clicking the input is single line and might be a little inconvenient. I reccomend using the TextBox from these modded nodes as the input for either of these inputs. This node suite also has a lot of math operator nodes that can come in handy when using these nodes. |
|
The Prompt Scheduler has multiple options that need to be converted to an input in order to properly use them. The Prompt weight channels (pw_a , pw_b , etc.) can take in the result from a Value scheduler giving full control of the token weight over time. |
|
An example setup that includes prepended text and two prompt weight variables would look something like this: |
"Note: I used keyframe string generator to manually set the animation curves in the value schedule."
Both nodes contain a max_frames value that determines the size of the series. This only needs to be equal to or higher than your last keyed prompt/value.
For expressions, you can check out supported numexpr operators and expressions and use them in your prompt.
Both nodes use the same variables:
Variable | Definition |
---|---|
t |
current frame |
max_f |
max frames |
Prompt Schedule Only Variables include:
Variable | Definition |
---|---|
pw_a |
prompt weight A |
pw_b |
prompt weight B |
pw_c |
prompt weight C |
pw_d |
prompt weight D |
The value of these prompt weight variables depends on what you give as an input.
This node interpolates prompts and automates prompt weights over time using expressions in the prompt.
To keyframe a prompt, you need to format it correctly.
"#":"(prompt:`exp`)"
where #
is the keyframe (as a whole number), prompt
is your prompt, and exp
is your expression.
The keyframe number needs to be enclosed by quotations (""
) followed by a colon (:
).
Your prompt also needs to be enclosed in quotations (""
).
If you plan on having another keyframed prompt after this one, you need to place a comma (,
) after the closing quote of your last prompt. If you don't do this you will get an error. If it is your last prompt do not place a comma as this will result in an error as well.
Expressions in the prompt schedule must be enclosed using back ticks: ``
not apostrpophes: ''
!!! If you are using prompt weight variables such as pw_a
, make sure it's enclosed inside backticks as well.
An example of syntax is as follows:
"0": "1girl, solo, long grey hair, grey eyes, black sweater, (smiling:`(0.5+0.5*sin(t/12))`)",
"24": "1girl, solo, long grey hair, grey eyes, black sweater, (dancing:`pw_a`)",
"48": "1girl, solo, long grey hair, grey eyes, black sweater, (dancing:`pw_a`)",
"72": "1girl, solo, long grey hair, grey eyes, black sweater, (smiling:`(0.5+0.5*sin(t/max_f))`)"
To alleviate having to write the full prompt to every keyed frame, the prompts that stay the same through the whole animation can be prepended or appended to every prompt in the schedule using pre_text
and app_text
respectively. I would suggest using the text box suggested in the important notes section. Converting the above example would look like this:
pre_text
1girl, solo, long grey hair, grey eyes, black sweater,
Scheduled Text
"0": "(smiling:`(0.5+0.5*sin(t/12))`)",
"24": "(dancing:`pw_a`)",
"48": "(dancing:`pw_a`)",
"72": "(smiling:`(0.5+0.5*sin(t/max_f))`)"```
This will be the same output prompts as the first example provided, makes the prompt schedule easy to read and it's easy to edit.
This node interpolates float values as well as calculates expressions given by the user through the text input.
To keyframe a value, you need to format it correctly.
#: (value)
where #
is you keyframe (as a whole number) and value
is your value or expression.
A colon (:
) needs to be placed between the key number and the value amd the value needs to be enclosed in parenthesis (()
). If you plan on having a value after, make sure you have a comma (,
) at the end of the keyed value or there will be an error.
An example of syntax is as follows:
0: (0.0), 24: (0.8), 48: (6%t), 72: (-cos(0.5*t/12))
Just a list of tools that you may find handy using these nodes.
Link | Description |
---|---|
Desmos Graphing Calculator | online graphing calculator. Handy for visualizing expressions. |
Keyframe String Generator | custom keyframe string generator that is compatable with the valueSchedule node. |
Audio framesync | Audi sync wave functions. Exports keyframes for the valueSchedule node. |
A special thanks to:
-The developers of Deforum for providing code for these nodes and being overall awesome people!
-Comfyanonamous and the rest of the ComfyUI contributors for a fantastic UI!
-All the friends I met along the way that motivate me into action!
-and you the user! I hope you have fun using these nodes and exploring latent space.