ComfyUI Node

Janus Chat

A conversation with Janus — two images, real back-and-forth

By yichengup·Created 2 years ago·Updated 2 years ago· 7
Janus Chat
  • janus_model
  • image_a
  • image_b
  • response
  • chat_history
question请描述这张图片。
seed42
temperature0.1
top_p0.95
max_new_tokens512
target_size1024
border_thickness2
clear_historyfalse

This is the node the pack's own description calls experimental, and it shows - in a good way. JanusChatAnalyzer ("Janus Chat") is the multi-turn version of the single-shot analyzer: it remembers what you asked, so you can interrogate an image the way you'd grill a witness. Ask what's in the scene, follow up with "what's the light source?", then "and how would that change in the evening?" - each question gets the context of the ones before it.

It also does the thing nothing else in the pack does: take a second image. You get image comparison in a plain chat node, which is a genuinely useful trick for side-by-side evaluation of two generations.

How it works

The mechanism is the interesting part. On every run it takes image_a (required) and, if you connect one, image_b (optional), composes them side by side - horizontally if they're wider than tall, stacked vertically otherwise - resizes the composite to target_size, and draws a bright green border between them so the model can tell where one image ends and the next begins. When two images are present it prepends a positional hint to your question, in Chinese: roughly "the left image is the first, the right is the second; the question is…". Then it stuffs the last few turns of chat history into the model's conversation format and generates a reply, appending both sides of the exchange to an in-memory history.

The inputs and outputs that matter

The question, janus_model, and image_a are the core. Beyond that you mostly set:

  • target_size - resolution the composed image is resized to before analysis (default 1024; 512–2048). Higher is sharper for the model to read, slower to process.
  • border_thickness - the green separator (default 2). Bump it if the model mixes the two images up.
  • clear_history - a boolean. Toggle it on for one run to wipe the conversation; the node answers with a Chinese "history cleared" confirmation.

temperature, top_p, max_new_tokens, and seed behave like the sibling analyzer node - defaults are fine.

Two outputs: response (the latest answer, STRING) and chat_history (a formatted, timestamped log of the whole conversation, STRING - handy to save or display as a transcript).

Install and the fiddly bits

Same pack install as everything else: Manager → search ComfyUI_Yc_JanusPro, or clone and restart; the pack pulls DeepSeek's janus package as its real dependency, and you need a model in ComfyUI/models/Janus-Pro/.

Where people trip up:

  • History is a per-node instance thing, held in memory. It lives as long as ComfyUI runs and the node isn't recreated - it does not persist across restarts, and it does not live in your workflow JSON. If your workflow behaves "differently" on a fresh boot, this is why. Use clear_history rather than trying to delete it.
  • The green border is baked into the image the model actually sees. Fine for chat, but don't expect a clean composite elsewhere.
  • It needs opencv-python (cv2) for the image compositing. That's the one dependency not guaranteed by ComfyUI itself; if the whole pack fails to load after install, missing cv2 is the first thing to check.

It's the quirkiest node in the pack and also the one with no direct equivalent - nobody else in this four-node set will compare two images in a running dialogue.

CategoryYc_JanusPro

Inputs (11)

NameTypeDefaultDescription
janus_modelJANUS_MODEL
image_aIMAGE
questionSTRING请描述这张图片。
seedINT420–18446744073709550000
temperatureFLOAT0.10–2
top_pFLOAT0.950–1
max_new_tokensINT5121–2048
target_sizeINT1024512–2048
border_thicknessINT21–10
clear_historyBOOLEANfalse
image_boptIMAGE

Outputs (2)

NameTypeDescription
responseSTRING
chat_historySTRING