Nodes/ComfyUI_LayerStyle_Advance/LayerUtility: Phi Prompt(Advance)
ComfyUI Node Runs on cloud

LayerUtility: Phi Prompt(Advance)

Phi Prompt — local text and vision inference with Microsoft's Phi-3.5

By chflame163·Created 2 years ago·Updated 4 months ago· 696
LayerUtility: Phi Prompt(Advance)
  • image
  • text
model
device
dtype
cache_modelfalse
system_promptYou are a helpful AI assistant.
user_promptDescribe this image
do_sampletrue
temperature0.50
max_new_tokens512

Runs Microsoft's Phi-3.5 models locally - no API key, no network call, everything happening on your own GPU (or CPU, slowly). Phi-3.5 is a small-model family that punches above its parameter count on a lot of benchmarks, which is the whole reason it exists: a genuinely capable LLM/VLM you can self-host without the footprint of something much larger. Use it to generate prompt words, rewrite existing prompt text, or describe an image, entirely offline once the weights are downloaded.

How it works

model picks between Phi-3.5-mini-instruct (text-only) and Phi-3.5-vision-instruct (image + text), or you can leave it on auto and let the node decide for you based on whether anything's wired into the optional image input - connect an image and it loads the vision model, leave it empty and it uses the text-only one. Convenient if you're building a graph that sometimes has an image and sometimes doesn't, since you don't need two separate nodes for the two cases.

The inputs and outputs that matter

  • model - auto / Phi-3.5-mini-instruct / Phi-3.5-vision-instruct, as above.
  • image (optional) - only used when the vision model is active.
  • device - cuda or cpu. dtype - fp16, bf16, or fp32; fp16/bf16 halve memory versus fp32 with minimal quality loss, standard tradeoff.
  • cache_model (default false) - keep the model resident between runs instead of reloading it every execution. Worth turning on if you're running this node repeatedly in a session.
  • system_prompt / user_prompt - role framing and your actual instruction.
  • do_sample (default true), temperature (default 0.5), max_new_tokens (default 512) - standard generation controls.

Output is a single text.

How to install it

Recommended: ComfyUI Manager, search "ComfyUI Layer Style Advance". Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git

Then install_requirements.bat / install_requirements_aki.bat, or pip install -r requirements.txt plus repair_dependency.bat. Restart.

Model files, and the VRAM warning worth taking seriously: the README states this node needs at least 16GB of video memory to run - meaningfully more than most of the other local-model nodes in this pack. Download Phi-3.5-vision-instruct and/or Phi-3.5-mini-instruct from Hugging Face (or the pack's Baidu mirror) into ComfyUI/models/LLM - grab whichever one(s) match how you plan to use model, or both if you want auto to genuinely work either way.

Common issues & troubleshooting

Out-of-memory errors, or the node crashing partway through. Check that 16GB VRAM figure against your actual GPU before assuming something's misconfigured - this is one of the heavier local nodes in the pack, not a lightweight one. If you're VRAM-constrained, this pack's SmolLM2/SmolVLM nodes are a much lighter alternative for similar text/vision tasks, at a real cost in output quality.

Error loading model xxx: We couldn't connect to huggingface.co. Standard network issue for anyone in a region where huggingface.co isn't directly reachable - the README's documented fix is setting HF_ENDPOINT=https://hf-mirror.com before the huggingface_hub package initializes.

Import errors on first load, or dependency conflicts. This pack's whole point, per its own README, is bundling nodes with heavier dependency requirements than the base LayerStyle pack - transformers version mismatches are the most common trigger. If you hit an import failure, running repair_dependency.bat (or the Aki equivalent) first is the documented fix before digging further.

Category😺dzNodes/LayerUtility

Inputs (10)

NameTypeDefaultDescription
modelCOMBO3 options: auto, Phi-3.5-mini-instruct, Phi-3.5-vision-instruct
deviceCOMBO2 options: cuda, cpu
dtypeCOMBO3 options: fp16, bf16, fp32
cache_modelBOOLEANfalse
system_promptSTRINGYou are a helpful AI assistant.
user_promptSTRINGDescribe this image
do_sampleBOOLEANtrue
temperatureFLOAT0.500.01–1
max_new_tokensINT5128–4096
imageoptIMAGE

Outputs (1)

NameTypeDescription
textSTRING