β If you find this project useful, consider starring the repository.
Composable prompt engineering toolkit for ComfyUI powered by Espanso.
This project turns Espanso into a modular prompt composition engine for AI image generation.
Instead of writing large prompts manually, prompts are built from reusable components.
- modular prompt components
- Espanso snippet system
- interactive prompt builder
- local prompt library admin
- automatic snippet documentation
- duplicate trigger detection
- development pipeline for validation & generation
- reproducible PowerShell installer
- installer logging system
Clone the repository:
git clone https://github.com/Delcado19/comfyui-prompt-ops.git
cd comfyui-prompt-opsRun the installer:
.\installer\install.ps1The installer automatically:
- installs Espanso with Winget, falling back to Scoop when Winget is unavailable or fails
- installs CopyQ with Winget, falling back to Scoop when Winget is unavailable or fails
- checks YAML parsing support
- installs project snippets
- generates snippet documentation
- restarts services if required
Installer logs are written to:
logs/install.log
portrait photo of a woman, cinematic lighting, close-up shot, shallow depth of field
:char_woman :ctx_portrait :cam_closeup :light_soft :style_cinematic
Espanso expands the triggers automatically into the final prompt.
The project includes an interactive prompt builder.
Trigger:
:prompt
The builder allows selecting:
- Model style preset
- Context
- Characters
- Scene
- Camera
- Lighting
- Style
- Quality
- Negative prompts
- NSFW modifiers
Selections are combined into a final prompt.
The builder snippet is automatically generated from the snippet library:
.\scripts\generate_prompt_builder.ps1Output file:
snippets/zz_prompt_builder.yml
Start the local admin interface:
npm run adminOr use the platform start script:
.\start-windows.batOn Windows, the start script opens the admin in your browser and keeps a logging window open. Close that window to stop the server.
sh ./start-linux.shOpen:
http://127.0.0.1:5177
The admin edits the central library:
library/prompt_library.yml
Generated outputs:
snippets/comfy_*.yml
snippets/zz_prompt_builder.yml
docs/snippets.md
Use the admin for adding, editing, deleting, and generating prompt categories and snippets.
Clone repository:
git clone https://github.com/Delcado19/comfyui-prompt-ops.git
cd comfyui-prompt-opsRun installer:
.\installer\install.ps1Installer pipeline:
- PowerShell version check
- package manager check
- Espanso installation via Winget with Scoop fallback
- CopyQ installation via Winget with Scoop fallback
- YAML support verification
- snippet installation
- snippet documentation generation
- service restart
- Windows 10 / Windows 11
- PowerShell 7+
- Git
- Winget, or Scoop as fallback
- Internet connection
Several development scripts rely on:
ConvertFrom-Yaml
If missing, the installer installs:
powershell-yaml
Manual installation:
Install-Module powershell-yaml -Scope CurrentUserVerification:
Get-Command ConvertFrom-YamlExpected output:
CommandType Name
----------- ----
Function ConvertFrom-Yaml
Prompt components are grouped by category.
| Prefix | Category |
|---|---|
:model_ |
Model style |
:ctx_ |
Context |
:char_ |
Characters |
:scene_ |
Scene |
:cam_ |
Camera |
:light_ |
Lighting |
:style_ |
Style |
:quality_ |
Quality |
:neg_ |
Negative prompts |
:nsfw_ |
NSFW modifiers |
Model style snippets describe prompt language that matches known local ComfyUI model families such as Z-Image Turbo, Flux2 Klein, SDXL Cinenauts, and wildcardXL fusion. They do not load models by themselves; they provide reusable text anchors for prompts.
Naming convention:
:<category>_<model-or-look>_<descriptor>
Examples:
:model_zit_jibmix
:style_zit_gothic_editorial
:scene_moonlit_garden
:qual_zit_material
Example snippet:
matches:
- trigger: ":ctx_portrait"
word: true
replace: "portrait, centered composition, subject facing camera"Snippets inside this repository are not automatically active in Espanso.
They must be copied to the Espanso match directory.
Run:
.\scripts\install_snippets.ps1This copies snippets from:
snippets/
to:
%APPDATA%\espanso\match
Example path:
C:\Users\<USER>\AppData\Roaming\espanso\match
Modify snippets inside:
snippets/
Run development pipeline:
.\scripts\dev.ps1Pipeline steps:
- snippet generation from
library/prompt_library.yml - YAML validation
- PowerShell syntax validation
- snippet validation
- duplicate trigger detection
- prompt builder generation
| Script | Purpose |
|---|---|
| doctor.ps1 | environment diagnostics |
| import_snippets_to_library.ps1 | migrate generated snippets to the central library |
| generate_snippets_from_library.ps1 | generate Espanso snippets from the central library |
| test_powershell_parse.ps1 | PowerShell syntax validation |
| validate_yaml.ps1 | YAML syntax validation |
| validate_snippets.ps1 | snippet validation |
| check_duplicate_triggers.ps1 | detect trigger conflicts |
| generate_snippet_docs.ps1 | generate snippet documentation |
| generate_prompt_builder.ps1 | build prompt builder |
| install_snippets.ps1 | deploy snippets |
| restart_services.ps1 | restart Espanso |
comfyui-prompt-ops
β
β docs
β admin.md
β architecture.md
β banner.png
β developer_workflow.md
β prompt_builder.md
β snippets.md
β snippet_system.md
β
β installer
β install.ps1
β
β library
β prompt_library.yml
β
β logs
β .gitkeep
β
β scripts
β check_duplicate_triggers.ps1
β dev.ps1
β doctor.ps1
β export_existing_snippets.ps1
β generate_prompt_builder.ps1
β generate_snippet_docs.ps1
β generate_snippets_from_library.ps1
β import_snippets_to_library.ps1
β install_snippets.ps1
β restart_services.ps1
β test_powershell_parse.ps1
β validate_snippets.ps1
β validate_yaml.ps1
β
β snippets
comfy_camera.yml
comfy_characters.yml
comfy_context.yml
comfy_lighting.yml
comfy_model.yml
comfy_negative.yml
comfy_nsfw.yml
comfy_quality.yml
comfy_scene.yml
comfy_style.yml
default.yml
zz_prompt_builder.yml
Additional documentation in:
docs/
- architecture.md
- developer_workflow.md
- prompt_builder.md
- snippets.md
- snippet_system.md
Contributions are welcome.
Please read:
CONTRIBUTING.md
before submitting changes.
MIT License
