LayerUtility: VQA Prompt
VQA Prompt — ask a model specific questions about an image
- image
- vqa_model
- text
VQA is Visual Question Answering - narrower than captioning. Instead of "describe this image," it's "answer this specific question about this image." This node is the half of the pair that actually asks the question; it needs a model loaded first by the companion Load VQA Model node, which brings in Salesforce's BLIP-VQA checkpoint.
How it works
Feed it an image, the vqa_model from Load VQA Model, and a question. The default question isn't a simple one-liner - it's a template full of placeholders: "{age number} years old {ethnicity} {gender}, weared {garment color} {garment}, {eye color} eyes, {hair style} {hair color} hair, {background} background." That structure, plus the fact the text output is a list rather than a single string, points to what this node is actually built for: filling in a structured character-description template field by field from what the model sees, one filled caption per image if you feed it a batch - exactly the shape of caption you'd want when building a training set for a character or portrait LoRA, where consistent, structured captions matter more than flowery prose.
Worth calibrating expectations here: BLIP is an older (2022) model line, and its general reputation in the captioning world is not great - the community's advice for open-ended captioning has moved on to newer options like JoyCaption or Florence 2. VQA is a more constrained task than free-form captioning, so it holds up better on specific, narrow questions, but don't expect deep reasoning out of it.
The inputs and outputs that matter
image- what to look at.vqa_model- the loadedVQA_MODELfrom Load VQA Model; this node does nothing without it.question- your question or template, multiline, editable from the default shown above.
Output: text, a list of strings - one answer per image if you're feeding a batch. Wire it straight into a prompt field, a dataset caption exporter, or a text-saving node.
How to install it
Ships with LayerStyle. ComfyUI Manager: search ComfyUI Layer Style, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
Restart, find it under 😺dzNodes → LayerUtility. This node itself doesn't fetch models - that happens over in Load VQA Model, which auto-downloads BLIP's VQA weights from Hugging Face the first time it runs. Make sure that loader has actually finished before expecting an answer here.
Common issues
Nothing happens, or you get an error immediately. Confirm vqa_model is actually wired from a working Load VQA Model node and that its first-run download finished - a half-downloaded or missing model is the most common reason this node fails outright.
Import errors mentioning transformers. Worth calling out specifically for this node: the transformers import failure that periodically takes out the entire LayerStyle pack traces, more often than not, straight through this node's own file - it leans on transformers' pipeline API directly, and a stale transformers version (frequently crossed with a stray tensorflow install shadowing that same API) breaks it. If your whole LayerStyle install shows "import failed," check your transformers version before anything else, and reinstall clean if you're on an install from before the pack split into base LayerStyle and the heavier LayerStyle Advance repo.
Answers read like generic captions instead of hitting your question. That's BLIP-VQA's ceiling, not a misconfiguration - it's a smaller, older model built for short, targeted answers. For anything requiring real reasoning about the image, this isn't the tool; it's built for fast, structured, batch-scale answers, not depth.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| vqa_model | VQA_MODEL | — | |
| question | STRING | {age number} years old {ethnicity} {gender}, weared {garment color} {garment}, {eye color} eyes, {hair style} {hair color} hair, {background} background. | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |