cfc1f4263edf2a2ef8ee9511bf21ae442ee9255f
prompt-generator-comfyui
Custom prompt generator node for ComfyUI
Setup
- Run
pip install happytransformercommand in the environment that you are launching ComfyUI with - Copy
prompt_generator.pyfile tocustom_nodesfolder in ComfyUI - Create
prompt_generatorsfolder undermodelsfolder in ComfyUI - Put your generator under
prompt_generatorsfolder. You can create your prompt generator with this repository - Run the ComfyUI
- Open the
hires.fixWithPromptGenerator.jsonworkflow
Features
- Print generated text to terminal and log the node's state in
generated_prompt.txtfile
Example Workflow
- Prompt Generator Node may look different with final version but workflow is not going to change
Variables
- For
model_typevariable copy and paste the model's name from this site like thistiiuae/falcon-40b - You can get information about variables from this link
How Recursive Works?
- Let's say we give
a,as seed and recursive level is 1. I am going to use the same outputs for this example to understand the functionality more accurately. - With self recursive, let's say generator's output is
b. So next seed is going to beband generator's output isc. Final output isa, c. It can be used for generating random outputs. - Without self recursive, let's say generator's output is
b. So next seed is going to bea, band generator's output isa, b, c. Final output isa, b, c. It can be used for more accurate prompts.
How Preprocess Mode Works?
- exact_keyword =>
(masterpiece), ((masterpiece))is not allowed. Parantheses are removed an looking for the keyword. First prompt is added to final prompt so add important prompts to seed. - exact_prompt =>
(masterpiece), ((masterpiece))is allowed but(masterpiece), (masterpiece)is not. Looking for the exact match of the prompt. - none => Everything is allowed even the repeated prompts.
Languages
Python
100%