TQD Score Estimate (TJ)
Score your training images with a local vision LLM
- image
- clip
- structure_score
- detail_score
- reasoning
- caption
- jsonl_line
- preview_text
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_fileprojector (same setup as the pack's other LLM nodes; Qwen2.5-VL GGUF is the recommended family).chat_handlerauto-detects. - ComfyUI TextGenerate - the alternative backend using ComfyUI's text-generate nodes (
text_encoder_namelikegemma4_e4b_it_fp8_scaled.safetensors, with aclip_loader_typepicker).
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.
temperaturedefaults to 0 - deterministic scoring, which is what you want for dataset labeling.save_resultswrites the image, a.txtcaption sidecar (generate_caption), andtqd_scores.jsonlintooutput_dir. Each JSONL line has exactlyimage_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.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_backend | COMBO | GGUF / llama.cpp | 2 options: GGUF / llama.cpp, ComfyUI TextGenerate |
| gguf_model | COMBO | qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q8_0.gguf | 1 options: qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q8_0.gguf |
| mmproj_file | COMBO | mmproj-qwen3.5-4B-Uncensored-HauhauCS-Aggressive-BF16.gguf | 2 options: none, mmproj-qwen3.5-4B-Uncensored-HauhauCS-Aggressive-BF16.gguf |
| chat_handler | COMBO | 1 options: NO_VISION_HANDLERS_AVAILABLE | |
| text_encoder_name | COMBO | gemma4_e4b_it_fp8_scaled.safetensors | 1 options: gemma4_e4b_it_fp8_scaled.safetensors |
| clip_loader_type | COMBO | Auto | 29 options: Auto, krea2, stable_diffusion, stable_cascade, sd3, stable_audio, +23 |
| n_gpu_layers | INT | -1-1–999 | — |
| n_ctx | INT | 8192512–32768 | — |
| max_tokens | INT | 32016–1024 | — |
| temperature | FLOAT | 0.000–2 | — |
| seed | INT | 00–18446744073709550000 | — |
| image_filenameopt | STRING | — | |
| output_diropt | STRING | — | |
| save_resultsopt | BOOLEAN | true | — |
| generate_captionopt | BOOLEAN | true | — |
| custom_promptopt | STRING | — | |
| clipopt | CLIP | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| structure_score | FLOAT | — |
| detail_score | FLOAT | — |
| reasoning | STRING | — |
| caption | STRING | — |
| jsonl_line | STRING | — |
| preview_text | STRING | — |