Nodes/Phi-3-mini in ComfyUI/🏖️Phi3mini 4k Chat
ComfyUI Node

🏖️Phi3mini 4k Chat

The 'conversation' node that's really a running transcript

By ZHO-ZHO-ZHO·Created 2 years ago·Updated 2 years ago· 207
🏖️Phi3mini 4k Chat
  • model
  • tokenizer
  • text
promptWhat is the meaning of life?
system_instructionYou are creating a prompt for Stable Diffusion to generate an image. First step: understand the input and generate a text prompt for the input. Second step: only respond in English with the prompt itself in phrase, but embellish it as needed but keep it under 200 tokens.
temperature0.00

Looks like the fun one - a chat node, right in ComfyUI. Wire in the model, type a message, get an answer back, repeat. But read the code before you get excited about multi-turn memory, because this is a transcript machine, not a conversationalist.

It's the sibling of 🏖️Phi3mini 4k from the same pack, with the same five inputs and the same single text output. The one difference: it keeps a log of your exchanges and returns the whole formatted history instead of just the latest answer. With the default system instruction - "You are creating a prompt for Stable Diffusion..." - it's built for iterating on prompt ideas. Each turn you feed in a new idea, it hands back an embellished English prompt, and the output shows the whole chain so far. That's the author's intended loop, and it's genuinely nice for the Chinese-input-to-English-prompt workflow the README advertises.

How it actually works (the honest version)

Every generate only sends the system instruction plus your latest prompt to the model. The chat_history list is display-only - responses get appended to it and formatted for output, but never fed back in as context. So there's no real memory between turns; the "multi-turn" you see is the log in the output box, not a model that remembers anything you said earlier. Two quirks to know if you read the log closely: the assistant's replies are stored under role "system" (a mislabel that doesn't affect generation but looks odd), and turns are separated by a line of 40 dashes.

Same gotcha as the single-shot node: temperature is accepted but do_sample=False is hardcoded, so the slider does nothing. Greedy decoding ignores it. It's the one knob on the node and it's a no-op.

Inputs and output

Identical schema to 🏖️Phi3mini 4k:

  • model / tokenizer - from the 🏖️Phi3mini 4k ModelLoader.
  • prompt (multiline) - your message / new prompt idea.
  • system_instruction (multiline) - default is the SD prompt-writer; edit it to change the job.
  • temperature (0–1) - see above. Decoration.
  • Output: text (STRING) - the full formatted transcript.

Where people get tripped up

  • Expecting real chat memory. If you want a model that actually re-reads earlier turns, this isn't it - you need a node that sends history back as messages, which this one never does. Use it as a running idea log instead.
  • The bundled workflow references a node you don't have. The pack's example chat workflow uses DisplayText_Zho, which lives in a different pack (the author's ComfyUI-Gemini). Load the example and ComfyUI will report it missing. Don't install another pack just for that - wire text into any display node you already own, like the built-in Show Text.

Install and first run

Same as the rest of the pack - ComfyUI Manager, search "Phi-3-mini", or:

cd ComfyUI/custom_nodes
git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-Phi-3-mini
cd ComfyUI-Phi-3-mini
pip install -r requirements.txt   # transformers>=4.40.0

then restart ComfyUI. Heavy lift is the model, not the install: the loader auto-downloads Phi-3-mini-4k-instruct from Hugging Face on first run and needs a CUDA GPU (it hardcodes device_map="cuda"). Stale transformers gives confusing tokenizer errors - the README's fix is pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers.

Bottom line: as a prompt-idea scratchpad where you want the whole history visible in one string, it's handy. As an actual conversation, it's a log with extra steps. Know which one you're getting and you'll be fine.

Category🏖️Phi3mini

Inputs (5)

NameTypeDefaultDescription
modelPHI3
tokenizerTK
promptSTRINGWhat is the meaning of life?
system_instructionSTRINGYou are creating a prompt for Stable Diffusion to generate an image. First step: understand the input and generate a text prompt for the input. Second step: only respond in English with the prompt itself in phrase, but embellish it as needed but keep it under 200 tokens.
temperatureFLOAT0.000–1

Outputs (1)

NameTypeDescription
textSTRING