Nodes/ComfyUI-TJ_NODE/TQD Score Estimate (TJ)
ComfyUI Node

TQD Score Estimate (TJ)

Score your training images with a local vision LLM

By designloves2·Created 4 months ago·Updated 2 days ago· 14
TQD Score Estimate (TJ)
  • image
  • clip
  • structure_score
  • detail_score
  • reasoning
  • caption
  • jsonl_line
  • preview_text
◄model_backendGGUF / llama.cpp►
◄gguf_modelqwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q8_0.gguf►
◄mmproj_filemmproj-qwen3.5-4B-Uncensored-HauhauCS-Aggressive-BF16.gguf►
◄chat_handler▾►
◄text_encoder_namegemma4_e4b_it_fp8_scaled.safetensors►
◄clip_loader_typeAuto►
◄n_gpu_layers-1►
◄n_ctx8192►
◄max_tokens320►
◄temperature0.00►
◄seed0►
◄image_filename—►
◄output_dir►
◄save_resultstrue►
◄generate_captiontrue►
◄custom_prompt►

Label your dataset's strengths instead of deleting its weaknesses

TQD Score Estimate (TJ) scores each image in a batch with a local vision LLM - giving it a structure_score (composition/pose) and a detail_score (face/detail) - and writes out the exact files a Krea2 TQD LoRA training run needs. TQD stands for Timestep-aware Quality Decoupling, a training approach that doesn't throw away imperfect images but instead exposes each one to the diffusion timesteps where it's strong. This node is the dataset-prep half of that: it's the thing that turns a pile of images into scored, captioned training data.

Straight up: this is an experimental node, marked as still in testing by the author, and it exists to feed one specific training pipeline (the author's musubi-tuner-gui tj-custom branch). If you're not training Krea2 LoRAs with TQD, you don't need this node. If you are, it replaces a miserable manual step - hand-scoring thousands of images - with a local model call.

How it works

The scoring runs through a local Vision-LLM via one of two model_backend options:

  • GGUF / llama.cpp - needs a GGUF vision model plus an mmproj_file projector (same setup as the pack's other LLM nodes; Qwen2.5-VL GGUF is the recommended family). chat_handler auto-detects.
  • ComfyUI TextGenerate - the alternative backend using ComfyUI's text-generate nodes (text_encoder_name like gemma4_e4b_it_fp8_scaled.safetensors, with a clip_loader_type picker).

Key behaviors worth knowing from the source:

  • Images are scored one at a time (deliberately never batched) to protect VRAM.
  • It skips images already present in the scores file and upserts re-scored images rather than appending duplicates.
  • temperature defaults to 0 - deterministic scoring, which is what you want for dataset labeling.
  • save_results writes the image, a .txt caption sidecar (generate_caption), and tqd_scores.jsonl into output_dir. Each JSONL line has exactly image_file, structure_score, detail_score.

The outputs that matter

Six of them, all list-type except preview_text: structure_score, detail_score, reasoning, caption, jsonl_line, and preview_text (a human-readable summary shown in the node). Practically, you'll use the scores/JSONL outputs if you want to wire the results somewhere, but the real product is the files written to output_dir.

Install it

This node is where the pack's LLM dependencies bite. Install the pack first:

cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE.git

Or via ComfyUI Manager → search TJ_NODE. Then for the GGUF backend you need llama-cpp-python - the default pip install is CPU-only and slow, and may not load modern vision models. GPU setup means building from source (the pack ships build_llama_gemma4.bat and LLAMA_GPU_SETUP.md covers a CMAKE_ARGS="-DGGML_CUDA=on" build). Models go in ComfyUI/models/text_encoders/ - main GGUF + mmproj both required for vision.

Where people get burned

The obvious one: a vision-handler error on the GGUF backend, which almost always means llama-cpp-python is too old or CPU-only - reinstall with GPU support. Second, the scores are only as good as the model, and the defaults are tuned for the author's uncensored Qwen3.5 4B - swap in a stronger vision model (Qwen2.5-VL 7B is the README's recommended) if your scoring feels mushy. And since this is explicitly experimental, keep the auto-verification it does (image count vs score count mismatch checks) turned on - a broken scores file at training time is a much worse failure than a warning here.

Category ✨ TJ_Node/LLM

Inputs (18)

NameTypeDefaultDescription
imageIMAGE—
model_backendCOMBOGGUF / llama.cpp2 options: GGUF / llama.cpp, ComfyUI TextGenerate
gguf_modelCOMBOqwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q8_0.gguf1 options: qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q8_0.gguf
mmproj_fileCOMBOmmproj-qwen3.5-4B-Uncensored-HauhauCS-Aggressive-BF16.gguf2 options: none, mmproj-qwen3.5-4B-Uncensored-HauhauCS-Aggressive-BF16.gguf
chat_handlerCOMBO1 options: NO_VISION_HANDLERS_AVAILABLE
text_encoder_nameCOMBOgemma4_e4b_it_fp8_scaled.safetensors1 options: gemma4_e4b_it_fp8_scaled.safetensors
clip_loader_typeCOMBOAuto29 options: Auto, krea2, stable_diffusion, stable_cascade, sd3, stable_audio, +23
n_gpu_layersINT-1-1–999—
n_ctxINT8192512–32768—
max_tokensINT32016–1024—
temperatureFLOAT0.000–2—
seedINT00–18446744073709550000—
image_filenameoptSTRING—
output_diroptSTRING—
save_resultsoptBOOLEANtrue—
generate_captionoptBOOLEANtrue—
custom_promptoptSTRING—
clipoptCLIP—

Outputs (6)

NameTypeDescription
structure_scoreFLOAT—
detail_scoreFLOAT—
reasoningSTRING—
captionSTRING—
jsonl_lineSTRING—
preview_textSTRING—