CXH_Phi_Run
Ask your images questions and get actual answers — that's this node
- phi_mode
- images
- out
This is the payoff node. CXH_Phi_Run is the inference half of StartHua's vision pipeline: you feed it a loaded Phi-3.5-vision model (from CXH_Phi_load), any image, and a plain-language prompt, and it returns a text answer as a string. Not a guess, not a "try these tags" suggestion - a generated sentence describing what the model actually sees. The author's own workflow uses it to ask "what color is the hair in this image, just output the color" and gets back something like "brown". It's a genuinely useful trick for checking your renders before you send them anywhere.
How it works
The node takes whatever IMAGE tensors you hand it, converts each one to a PIL image, and builds a <|image_1|>, <|image_2|> placeholder for each - so multi-image questions work, and the model knows which is which. It then runs the prompt and images through Phi-3.5's chat template and processor, feeds the lot to model.generate() on cuda:0, strips the input tokens, and decodes the answer.
Two mechanism details worth knowing. First, generation is greedy: the code hardcodes do_sample=False, so the temperature input is currently decorative - crank it all you want, output won't change. Second, all of this is happening on a 4.2B model, so answers come back in a second or three on a decent GPU, not instantly. Slow enough to feel, fast enough to iterate.
Inputs that matter
- phi_mode - the
CXH_PHI_PIPbundle from CXH_Phi_load. The Run node has no idea what to do without it. - images - any
IMAGEoutput.LoadImageis the obvious source, but a KSampler output works too, so you can interrogate something you just generated in the same graph. - prompt - multiline, no default. Be specific. "What color is the hair" beats "describe this image" every time, and the model will happily follow instructions like "only output the color".
- max_new_tokens - default 2048, range 100–10000. Fine as-is unless you're asking for long essays.
- temperature - exists, defaults to 0, currently ignored (see above).
Output is a single STRING named out. ComfyUI core won't show it to you - you need a text-display node. The pack's bundled workflow uses easy showAnything from ComfyUI-Easy-Use, which is the easy path; any "show text" node works. If you don't have one, that missing-node error is what you're seeing.
Install
Via ComfyUI Manager (search Comfyui_CXH_Phi_3.5) or:
cd ComfyUI/custom_nodes
git clone https://github.com/StartHua/Comfyui_CXH_Phi_3.5
# restart ComfyUI, then run CXH_Phi_load once to grab the ~9GB model
First run downloads the model; every run after that just uses it. The pack's requirements.txt pins flash_attn==2.5.8, which is a compiled pain point you don't need - the default eager attention in the loader skips it entirely.
Where people get burned
- Expecting a real conversation. Every run is a fresh, single question. There's no memory between runs, so "what about the background?" means repeating the context.
- Temperature not working. It's a trap if you read the widget and assume sampling. Greedy decoding is fine for factual Q&A, but don't expect creative variation.
- VRAM. The 4.2B vision model sits in VRAM the whole time your workflow is queued. On an 8GB card alongside a diffusion model, expect swapping. 12GB+ is where this gets comfortable.
And a honest sizing take: if your goal is mass captioning a folder, this is the wrong tool - Florence-2 and JoyCaption are what the community actually reaches for there. Where this node wins is the open-ended question: asking a specific thing about your image, mid-workflow, and routing the answer into a decision or a prompt.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| phi_mode | CXH_PHI_PIP | — | |
| prompt | STRING | — | |
| images | IMAGE | — | |
| temperature | FLOAT | 0.000–1 | — |
| max_new_tokens | INT | 2048100–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| out | STRING | — |