I do not know how to code. I created this project with the help of AI, then tested and refined it through many real ComfyUI generations. Bugs may still exist, so detailed feedback is welcome.
YAML Prompt Studio for ComfyUI:
YAML Prompt Studio is a custom ComfyUI node that builds a complete prompt from separate YAML libraries. It is designed for users who generate many character variations and want to manage their prompts without rewriting everything manually.
What it controls:
The main node can select and combine:
- checkpoint and model-specific text encoder.
- positive and negative global prompts.
- character and main outfit.
- pose and background.
- outfit or cosplay.
- style and expression.
- transformation or alternate physique.
- partner when the selected pose contains the exact `1boy` tag.
- tattoo.
- LoRAs written directly inside any positive prompt source.
Each component can be enabled or disabled independently. Entries may be selected manually, randomly, from one category only, or through compatibility rules based on YAML tags.
Main functions:
- Color-coded control interface.
- Random, weighted, compatible-random and category-random selection.
- Compatibility rules between characters, poses, backgrounds and outfits.
- Prompt conflict removal through `Overrides.yaml`.
- Checkpoint-specific CLIP and prompts through `ModelSettings.yaml`.
- Adjustable probabilities for main outfits, styles, transformations, tattoos and nudity.
- Favorites, reusable profiles and anti-repetition history.
- `Re-use` buttons in the generation diagnostic.
- Final positive and negative prompts separated by source.
- Automatic refresh of YAML files, checkpoints, LoRAs and text encoders.
- Integrated YAML editor with validation and automatic backups.
- Complete library verification and pre-generation diagnostic.
- Restoration of node settings from PNG metadata.
- Generation history containing the last 200 configurations.
- Face Count Guard and Image Health Guard for long unattended batches.
The Image Health Guard can stop a workflow before saving when an image is black, blank, non-finite or otherwise invalid. The Face Count Guard can report when the detected number of faces does not match the number expected from the selected pose and partner settings.
Requirements:
For YAML Prompt Studio itself:
- ComfyUI.
- Python dependency listed in "requirements.txt".
For the included example workflow:
- ComfyUI Impact Pack.
- a WAI-ANIMA checkpoint.
- the matching text encoder and VAE.
- "RealESRGAN_x4plus_anime_6B.pth" or another compatible upscale model.
- face and hand detector models used by Impact Pack.
The example workflow currently references:
- waiANIMA_v10Base10.safetensors
- qwen_3_06b_base.safetensors
- qwen_image_vae.safetensors
- RealESRGAN_x4plus_anime_6B.pth
- bbox/face_yolov8m.pt
- bbox/hand_yolov8s.pt
Change these filenames in the workflow or "ModelSettings.yaml" if your installed files use different names.
Compatible extensions:
YAML Prompt Studio has been specifically adapted and tested with:
- ComfyUI-EX-TagComplete. (jupo-ai/comfy-ex-tagcomplete)
tag autocomplete works inside the positive and negative prompt fields embedded in the YAML Prompt Studio interface.- ComfyUI-Lora-Manager. (willmiao/ComfyUI-Lora-Manager)
the "LoRA Manager → positive prompt" button can add a selected LoRA on a new line. Trigger words are added at the same time when LoRA Manager provides them.- ComfyUI Impact Pack. (ltdrdata/ComfyUI-Impact-Pack)
used by the included example workflow for FaceDetailer, face and hand detectors, and face-count analysis.
ComfyUI-EX-TagComplete and ComfyUI-Lora-Manager are optional. ComfyUI Impact Pack is only required when using the included example workflow or its detector/detailer section.
Installation:
1. Close ComfyUI.
2. Extract "ComfyUI-YAML-Prompt-Studio" into "ComfyUI/custom_nodes/".
3. Install the dependency:
```bash
pip install -r ComfyUI/custom_nodes/ComfyUI-YAML-Prompt-Studio/requirements.txt
```4. Restart ComfyUI.
5. Hard-refresh the browser with `Ctrl+F5`.
6. Load `YAML-Prompt-Studio-Example-Workflow.json` or add `YAML Prompt Studio` from the node menu.
Description
YAML Prompt Studio V1.1 — YAML Editor Update Version 1.1 introduces a complete redesign of the built-in YAML editor. The new interface is inspired by Visual Studio Code and is intended to make large prompt libraries easier to browse, edit, and maintain. New editor interface - Visual Studio Code-inspired workspace. - Dedicated file explorer and editor area. - Tabs provide quick navigation between open files. - Unsaved files are clearly marked.
YAML readability - YAML syntax highlighting. - Line numbers. - Vertical indentation guides to make nested categories easier to follow. - Improved display of comments, keys, values, lists, and compatibility fields. - Horizontal scrolling for long prompt lines instead of forced line wrapping. Collapsible categories - Individual YAML categories can be collapsed and expanded from the line-number gutter. - Dedicated buttons collapse or expand every category in the active file. - Press `Alt + W` to toggle between **Collapse All** and **Expand All**. - Collapsed sections display a compact summary while preserving their original content. - Editing a collapsed region safely restores its complete source before applying changes. Editing and navigation - Built-in search for the active document. - Keyboard-friendly editing and navigation. - `Ctrl + S` saves the active file. - Switching between files does not discard unsaved work. - Explorer and inspector panels can be hidden to increase the available editing space. Validation and safety - YAML syntax is validated before saving. - Referenced LoRA files can be checked from the editor. - Every successful save creates an automatic backup. - Concurrent modification protection prevents accidentally overwriting a file changed outside the editor. - Existing YAML comments are preserved. - No changes are required to existing YAML file structures. Updated files - `web/yaml_editor.html` - `character_yaml.py` Updating from V1.0 1. Replace the updated files in the YAML Prompt Studio custom-node folder. 2. Restart ComfyUI completely. 3. Reload the browser interface with `Ctrl + F5`. 4. Open the YAML editor from the YAML Prompt Studio Control Center.
