Flux2TTRTrainingParameters
One Config Node to Rule Both Training Phases
- training_config
Flux2TTRTrainingParameters doesn't train anything itself - it's the shared config bag that both training phases read. You dial in the loss weights, optimizer settings, and Comet logging once, and it emits a TTR_TRAINING_CONFIG wire that feeds Flux2TTRControllerTrainer (required there) and Flux2TTRTrainer (optional there). One set of hyperparameters across Phase 1 and Phase 2 is the whole point: the distillation and the controller are trained against the same numbers, and you don't have to keep two workflows in sync by hand.
The inputs that matter
For a first run, the inputs that actually matter are a small handful:
- rmse_weight and cosine_weight - both default 1. These are the workhorse quality terms in controller training.
- Everything else starts at 0:
lpips_weight,dreamsim_weight,hps_weight,biqa_quality_weight,biqa_aesthetic_weight,gemini_similarity_weight,gemini_quality_weight. Raising any of them pulls in that scorer - a heavy dependency (pyiqa, hpsv2, dreamsim) or, for the Gemini terms, the Google API. - target_ttr_ratio (0.7), lambda_eff (1), lambda_entropy (0.1) - the reward-shaping knobs for the controller.
target_ttr_ratiois the fraction of eligible layers you want routed to the fast TTR path. - learning_rate (1e-4), grad_clip_norm (1), huber_beta (0.05) - optimizer and Phase-1 loss settings.
- comet_enabled - defaults to false, so you're not shipping runs to a cloud dashboard unless you flip it.
Gemini, only if you ask for it
The Gemini angle deserves a callout, because it's easy to misread. The node has gemini_model (default gemini-3-flash-preview), gemini_api_key, and gemini_api_key_env (default GEMINI_API_KEY), but with both gemini weights at zero the trainer never calls the API. You only need a key when you raise gemini_similarity_weight or gemini_quality_weight - and those calls cost real money, image-by-image. The key field is a plaintext string sitting in your workflow JSON, so think twice before sharing a workflow with a key baked in. Better: leave it empty and set the GEMINI_API_KEY env var.
Output is a single training_config (TTR_TRAINING_CONFIG), which is what you wire into the trainer nodes.
It's a config node, so there's nothing to get wrong at runtime - the failure modes live in whatever trainer you feed it to. The one genuine trap is the optional quality scorers. The pack's installer (via uv pip install -e custom_nodes/ComfyUI-Taylor-Attention, or bash install_requirements.sh /venv/main) handles pyiqa, hpsv2, and dreamsim, but image-reward is explicitly not installed by default because it pins an old timm that breaks pyiqa. If a tutorial tells you to add it, don't.
Installing and gotchas
Install the pack through ComfyUI Manager (search "Taylor-Attention") or clone it into custom_nodes, then restart and run the dependency install above. Note the README's one-liner still names the old folder ComfyUI-Approximate-Attention - use the folder you actually cloned. No model files are downloaded; the checkpoints end up under ComfyUI/models/approximate_attention/. This is a research pack with essentially zero community footprint and everything flagged experimental - treat the defaults as the author's best guess and tune from there.
Inputs (30)
| Name | Type | Default | Description |
|---|---|---|---|
| rmse_weight | FLOAT | 1.0000–1000 | — |
| cosine_weight | FLOAT | 1.0000–1000 | — |
| lpips_weight | FLOAT | 0.0000–1000 | — |
| dreamsim_weight | FLOAT | 0.0000–1000 | — |
| hps_weight | FLOAT | 0.0000–1000 | — |
| biqa_quality_weight | FLOAT | 0.0000–1000 | — |
| biqa_aesthetic_weight | FLOAT | 0.0000–1000 | — |
| gemini_similarity_weight | FLOAT | 0.0000–1000 | — |
| gemini_quality_weight | FLOAT | 0.0000–1000 | — |
| gemini_model | STRING | gemini-3-flash-preview | Gemini model used for image-to-image quality scoring when Gemini weights are enabled. |
| gemini_api_key | STRING | Optional Gemini API key value. If empty, gemini_api_key_env is used. | |
| gemini_api_key_env | STRING | GEMINI_API_KEY | Environment variable name that holds the Gemini API key. |
| reward_baseline_quality_floor | FLOAT | -0.300-10–1 | Clamp floor for reward-baseline EMA updates in controller training. |
| huber_beta | FLOAT | 0.05000.000001–10 | — |
| learning_rate | FLOAT | 01e-7–1 | — |
| grad_clip_norm | FLOAT | 1.0000–100 | — |
| alpha_lr_multiplier | FLOAT | 5.0000–100 | — |
| phi_lr_multiplier | FLOAT | 1.0000–100 | — |
| target_ttr_ratio | FLOAT | 0.7000–1 | — |
| lambda_eff | FLOAT | 1.0000–100 | — |
| lambda_entropy | FLOAT | 0.1000–1 | — |
| gumbel_temperature_start | FLOAT | 1.0000.0001–10 | — |
| gumbel_temperature_end | FLOAT | 0.5000.0001–10 | — |
| warmup_steps | INT | 00–1000000 | — |
| comet_enabled | BOOLEAN | false | — |
| comet_api_key | STRING | — | |
| comet_project_name | STRING | ttr-distillation | — |
| comet_workspace | STRING | — | |
| comet_experiment | STRING | c6376d52026072021405003308600636 | Comet experiment key. Use a stable value to keep logging to one persistent experiment. |
| log_every | INT | 101–1000000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| training_config | TTR_TRAINING_CONFIG | — |