Gallery Prompt Manager is a ComfyUI custom node pack for browsing image folders as prompt assets, scanning images into sibling JSON metadata, and combining prompt halves for reuse.
Private prototype in progress.
Implemented now:
GPM Gallery Browserv1 backend prototype (folder navigation + image selection + sibling JSON load)GPM Prompt Combinerv1 (person + scene + optional LoRA tags -> one clean prompt string)GPM VLM Scannerv1 (recursive scan + fixed-family sidecar writes via preset-selected family)GPM VLM Scanner (Internal)v2 (subprocess-isolated internal runtime with ComfyUI model-folder dropdown UX)GPM VLM Scanner (Internal Advanced)v1 (same subprocess-isolated runtime with manual tuning controls)GPM VLM Internal Diagnosticsv1 (environment/status helper for internal GGUF multimodal support)- Global VLM preset storage with built-in read-only defaults (
SDXL,Pony,Natural Language)
Not implemented yet:
- clickable thumbnail frontend
- advanced prompt versioning workflows
Purpose:
- browse a folder tree under a chosen root folder
- enter folders and go back to parent folder
- select one image file
- load sibling JSON fields (
sdxl_person,sdxl_scene) if present
Supported image files:
.jpg.jpeg.png.webp.bmp
Ignored in browser listing:
- non-image files
.jsonsidecars
JSON contract (v1):
{
"sdxl_person": "...",
"sdxl_scene": "..."
}Behavior on missing/invalid JSON:
- image output still works
person_promptoutput returns""whensdxl_personis missing/invalidscene_promptoutput returns""whensdxl_sceneis missing/invalid
Persistence behavior:
- each
GPM Gallery Browsernode instance persists its ownroot_folder,current_subfolder,selected_image_rel, andvisible_rowsusing the ComfyUI node id
Purpose:
- combine
person_prompt,scene_prompt, andlora_tagsin that order - ignore empty inputs
- join non-empty parts with
", " - trim and normalize whitespace/comma spacing to avoid awkward separators
Output:
combined_prompt
Purpose:
- recursively scan image files under a root folder
- run GGUF VLM inference using a selected preset id
- map preset family to fixed sidecar keys:
SDXL->sdxl_person/sdxl_scenePony->pony_person/pony_sceneNatural Language->natural_person/natural_scene
- preserve unrelated JSON fields when writing family fields
- support
SKIP_EXISTING(default) andOVERWRITE_FAMILY - writes minimal scan metadata to
gpm_meta.vlm_scan:familypreset_idbackendruntimemodelstatusscanned_at
- when internal scanner
debug_mode=ON, verbose runtime/debug metadata is written togpm_meta.vlm_scan_debug- plus per-image trace under
gpm_meta.vlm_scan_debug_trace:source_image_filenamesource_image_full_pathsource_image_sha256output_json_full_pathmodel_prompt_sentraw_model_responseparsed_person_promptparsed_scene_promptdetected_model_familyselected_chat_handlerfamily_support_statussupport_reason
- debug guard: if a response looks like generic family/living-room text for a likely different image type (for example storefront/cafe filename hints), scans in debug mode will warn and skip overwriting existing JSON for that image
- plus per-image trace under
Purpose:
- run the same scan orchestration as the API scanner through
runtime_mode=internal - load GGUF VLM + mmproj in an isolated subprocess worker via
llama-cpp-python - discover model files from ComfyUI model folders and expose dropdowns (
model_name,mmproj_name) - support
mmproj_name=(auto)matching when one clear candidate exists - use an explicit internal family support gate before scan execution:
- internal scan correctness is currently verified for
Qwen2.5-VLonly - unverified families (including Gliese/Qwen3.x and other unvalidated multimodal families) are blocked with a clear startup error instead of scanning
- internal scan correctness is currently verified for
- use a dedicated Qwen-VL runtime path (Qwen handler + filtered llama constructor kwargs)
- multimodal request image payload remains family-aware (
qwen_vluses object-styleimage_url)
- multimodal request image payload remains family-aware (
- optional
debug_mode=ONemits concise startup compatibility diagnostics insummary_jsonwhen internal startup fails - worker exits after each scan, which is the primary VRAM release mechanism
keep_model_loadedis internal-only and always ON during a scan run (not a user-facing widget)
Purpose:
- same subprocess-isolated scanner flow as the basic internal node
- exposes advanced runtime controls (
n_ctx,n_gpu_layers,temperature,top_p,max_tokens,threads,batch_size) - keeps the same no-executable-path UX as the basic internal node
- includes optional
debug_modetoggle with the same startup diagnostics behavior as the basic internal node
Internal runtime note:
- For internal GGUF scanning,
keep_model_loadedis always ON internally during the scan run. - Both internal scanner nodes always run in subprocess mode.
- Worker exit after each scan releases VRAM reliably.
Purpose:
- quickly report local Python/platform +
llama_cppimport/version status - inspect
llama_cpp.llama_chat_formatfor multimodal handler attributes/classes - infer internal family from selected
model_name - resolve selected
model_name/mmproj_nameto filesystem paths and report existence - report whether inferred family appears supported by the installed build
- diagnostics only (does not load model)
Internal model locations:
ComfyUI/models/llm/ComfyUI/models/llm/GGUF/ComfyUI/models/GGUF/
Internal dependency note:
- Qwen-VL GGUF internal mode requires a vision-capable
llama-cpp-pythonbuild that supports both Qwen VL chat handlers and the corresponding llama.cpp model backend.
Discovery behavior:
- main VLM models:
*.gguffiles excluding names containingmmproj - mmproj files:
*.gguffilenames containingmmproj
Global preset storage:
- file:
gpm_vlm_presets.jsonin the node package directory - auto-created if missing
- built-ins are read-only defaults
- user presets are supported as global recipes and are not duplicated into image sidecars
- built-in ids:
builtin-sdxl,builtin-pony,builtin-natural-language - managed user preset ids:
sdxl_user,pony_user,natural_user(auto-created from matching built-ins if missing) - preset schema includes
system_prompt,ban_list,temperature,top_p,max_tokens
GPM Gallery Browser uses node controls for navigation:
root_folder: start/root foldercurrent_subfolder: active folder relative to rootaction:refresh,enter_folder,back,select_imageentry_name: folder or image name in the current folder
UI feedback is returned in node UI fields:
- status
- current subfolder
- folder/image listing text (
[DIR]then[IMG])
Browser outputs:
imageperson_promptscene_promptselected_image_path
src/-> ComfyUI node package codetests/-> core-logic testsdocs/-> durable project documentationscripts/-> helper scripts and verification helperstools/-> external/maintenance tooling
Supported install path (recommended):
- Install Gallery Prompt Manager from ComfyUI Manager (GitHub/listing flow).
- Restart ComfyUI if Manager or your launcher requests it.
- Use
GPM VLM Internal Diagnosticsif you want a quickllama_cppand internal readiness check.
Advanced/manual fallback:
- Copy/clone this repo into
ComfyUI/custom_nodes/. - Install normal requirements in the same Python environment ComfyUI uses:
python -m pip install -r .\requirements.txt
- Run
python .\install.py(specialllama-cpp-pythonwheel handling path). - Restart ComfyUI.
Then:
- Add
GPM Gallery Browser,GPM Prompt Combiner, and one scanner node (GPM VLM Scanner,GPM VLM Scanner (Internal), orGPM VLM Scanner (Internal Advanced)) from categoryGPM. - Set browser
root_folder, then useaction+entry_nameto navigate/select. - Connect browser
person_prompt+scene_promptinto combiner inputs; optionally setlora_tags.
Browser UI includes:
- prompt profile selector:
SDXL,Pony,Natural Language(SDXL implemented end-to-end now) - randomize selector:
OFF,ON Save to JSONbutton for writing active profile prompt edits to the selected image sibling JSON
One-time JSON migration helper:
python .\scripts\migrate_prompt_keys.py <your_image_root>requirements.txtintentionally contains only normal, low-risk dependencies.llama-cpp-pythonis intentionally not listed inrequirements.txtand is handled as a special-case install ininstall.py.install.pychecksimport llama_cppfirst:- if already installed, it does not reinstall
- if missing, it can try CUDA/cuBLAS index path when CUDA is applicable
- in
auto/cuda, unsupported CUDA wheel families do not trigger local source build; installer falls back to CPU wheel install - local CUDA source build is advanced opt-in only via
GPM_LLAMA_INSTALL_MODE=cuda-build - if CUDA wheel or source build path is unavailable/fails, it falls back to plain
pip install --upgrade llama-cpp-python
- optional install mode override is available with
GPM_LLAMA_INSTALL_MODE(auto,cpu,cuda,cuda-build). - on GPM module import, startup diagnostics print dependency status (
Pillow,llama_cpp, internal support import, readiness) without running pip. - Manager installs should normally not require manual commands;
install.pyremains available for specialllama-cpp-pythonwheel handling when needed. - Internal scanner readiness depends on both:
- successful
llama_cppimport, and - successful import of GPM internal support modules.
- successful
- Scanner prompt tuning and system-prompt/model-family refinement are separate future work and are not changed by install flow.
docs/setup.mddocs/architecture.mddocs/troubleshooting.mddocs/decisions.mdROADMAP.mdTASKS.md