Prompt Expansion for Stable Diffusion, using Deepseek API.
Stable Diffusion Prompt Expansion using Deepseek API
config.ini.example
to config.ini
and put the replicate key there.Navigate to where you have installed ComfyUI. For example:
cd ~/dev/ComfyUI/
Go to the custom nodes folder:
cd custom_nodes
Clone this repo
git clone https://github.com/smlbiobot/sml-comfyui-prompt-expansion
Go inside the repo folder
cd sml-comfyui-prompt-expansion
Install the requirements
pip install -r requirements.txt
Copy the example config config.ini.example
to config.ini
, then edit the config.ini
with the actual Repliate API token.
cp config.ini.example config.ini
Start ComfyUI.
Setting min 1000, max 3000 will generate between 1000 and 3000 characters. This prompt length is generally good for models like Flux and SDXL. If you’re working with SD 1.5, you may wish to set this to a lower value.
This prompt expansion node is not intended for SD 1.5, since SD 1.5 uses a different style of prompt.
The DeepSeek engine is used to generate the expanded prompt. It has a caching mechanism that would output the same result given the same user prompt. To ensure that the same prompt will in fact output different results, I’ve employed a few tactics through salting:
This shows a very simple prompt expanded into a complex paragraph.
A real example for Flux Pro Ultra output.
Please open an issue if you have any suggestions or questions.