← Back to Leaderboard
CNynxz

Nynxz/ComfyUI-PlatoKeys

Closed-form encoder remapping for ComfyUI diffusion conditioning

View on GitHub ↗
Engineering Health (Methodology)
A · 76/100
Maintenance Activity
● Updated today
Latest Release
Rolling commits (main)
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption10/25
Release Cadence11/20
License Clarity20/20
Local AICLIGPU
Total Stars
★ 38
24h Growth
+0
7d Growth
+33
Forks
4

GitHub Star History

Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.

Nynxz/ComfyUI-PlatoKeys Star History (2026-11-25 - 2026-12-04) DAILY STAR HISTORY (10-DAY D1 TELEMETRY) +37 in 9d · avg +4/day 42 21 0 2026-11-25: ★ 12026-11-26: ★ 22026-11-27: ★ 142026-11-28: ★ 212026-11-29: ★ 272026-11-30: ★ 312026-12-01: ★ 322026-12-02: ★ 382026-12-03: ★ 382026-12-04: ★ 38 ★ 38 11-25 11-29 12-04

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

PlatoKeys is a Python custom-node extension for ComfyUI V3 that separates encoder calibration from inference. The calibration CLI loads the source and target encoders sequentially and accumulates weighted first- and second-order statistics in float64. Memory for those statistics does not grow with the number of token pairs, but the matrices still grow with feature width. A thin SVD yields the semi-orthogonal Procrustes map; closed-form Ridge provides a regularized fit that can adjust individual channel scales.

At inference, Load Plato Key supplies a safetensors projection and metadata to the graph. Plato Key Encode handles prompt encoding directly, while Patch CLIP clones the CLIP object and wraps tokenization and encoding for downstream consumers. Both use the key’s layer, normalization, chat-template, and prefix-strip settings; temporary overrides of SDClipModel defaults are restored in a finally block without modifying ComfyUI core. The manifest declares safetensors as its only direct dependency; node execution relies on the ComfyUI host.

Key Capabilities & Differentiators

The extension handles both single-layer targets and stacked hidden states. For Krea 2, it aligns calibration pairs across different tokenizers using UTF-8 byte spans, projects into the 12 Qwen3-VL-4B layer taps, then flattens [B, 12, seq, 2560] into [B, seq, 30720]. Patch CLIP can also project visual tokens from a compatible source encoder, as in the Qwen3-VL-4B → Z-Image route.

The MOSS-Image Qwen3.5-2B → Qwen3.5-9B Ridge key is 16.8 MB, with held-out token cosine of 0.8978 and R² of 0.7486. The Krea 2 Qwen3.5-2B and 9B routes use 121 MB and 241 MB keys, with R² values of 0.7412 and 0.7723, respectively. Compare Conditioning can check mapped tensors against native ones; Compose Plato Keys can combine compatible routes through a hub into a single inference projection.

Trade-offs & Limitations

The native encoder is the baseline when conditioning fidelity and minimal integration work take priority. PlatoKeys is useful when a different source encoder is worth the extra compatibility checks: the target encoder can stay out of the mapped inference branch, but the source checkpoint, extraction layer, normalization, template, and prefix handling must match the key. A smaller source can reduce encoder cost; a larger source or a wide multi-layer projection can instead add overhead. Key file size is not a measurement of runtime VRAM.

Compared with training a learned adapter, a closed-form fit removes the gradient-training loop but limits the mapping to what can be recovered linearly from the source representations. Calibration fit scores characterize hidden states, not image quality, prompt adherence, or end-to-end speed. Before replacing the native path, run an A/B comparison on representative prompts and any visual inputs, and measure memory and runtime on the full graph.

Hardware & Deployment Guide

Install the source checkout under ComfyUI/custom_nodes and restart ComfyUI. Put a matching pre-calibrated key in ComfyUI/models/plato_keys/ or register an alternate location through extra_model_paths.yaml. Once the models and key are local, inference does not require a hosted API. The manifest identifies package version 0.1.0, but no GitHub release is listed, so record the working plugin and ComfyUI revisions alongside the encoder checkpoints and key file.

For a custom route, scripts/calibrate_comfy.py consumes local ComfyUI checkpoints and supports quantized int8/fp8 inputs and multi-layer extraction. scripts/calibrate.py provides the Hugging Face path and has a companion Colab notebook. Its --target-8bit and --target-4bit flags are options for fitting Qwen3.5-9B calibration on a 16 GB GPU. Use --save-stats and --from-stats to refit on CPU without rerunning the encoder passes.

Calibration: Streaming float64 statistics support semi-orthogonal Procrustes via thin SVD and closed-form Ridge without storing every token pair.
Tokenizer alignment: UTF-8 byte-span pairing calibrates routes across Qwen3.5 and Qwen3-VL tokenizers.
Multi-layer output: Krea 2 keys project 12 layers and flatten the 12 × 2,560 stack into 30,720 channels per token.
Graph integration: Patch CLIP preserves the CLIP-facing interface for downstream text and visual nodes; Apply Plato Key handles existing single-layer conditioning.
Key composition: The Hub node folds compatible A → Hub → B maps into one projection and supports documented 2D and stacked key forms.
Validation: Compare Conditioning exposes per-token cosine, RMS ratio, and relative L2 against native target conditioning.
Best For

Local ComfyUI teams that want to reuse a smaller or vision-capable encoder, have a matching key or can calibrate one, and can compare outputs against the native path.

Skip If

You need native conditioning fidelity, cannot maintain checkpoint-to-key compatibility, or need proven image-quality and speed gains without running your own evaluation.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Local AICLIGPU
cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-PlatoKeys

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/Nynxz/ComfyUI-PlatoKeys.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

Nynxz/ComfyUI-PlatoKeys Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about ComfyUI-PlatoKeys

Which node should I use to integrate an alternate encoder?

Use Plato Key Encode for a direct replacement of CLIPTextEncode. Use Patch CLIP when downstream nodes need a CLIP object, when the workflow carries visual tokens, or when you want to preserve a multi-layer path such as Krea 2. Apply Plato Key is for existing single-layer conditioning that already matches the key’s extraction and template settings.

Will it reduce VRAM, and what hardware does calibration need?

Inference needs the source encoder and the projection, not the native target encoder for that conditioning branch. Net VRAM savings depend on the source checkpoint, projection dimensions, and the rest of the ComfyUI graph. Calibration loads encoders sequentially and can refit saved statistics on CPU. The 16 GB example applies to quantized Qwen3.5-9B in the Hugging Face calibration path; it is not a sizing guarantee for the full generation workflow.

Can I self-host it for commercial workloads?

The plugin code is Apache-2.0 licensed and runs inside local ComfyUI without a hosted inference service. Review the licenses of the encoder checkpoints, diffusion models, and downloaded key artifacts separately before commercial use or redistribution; the plugin license does not cover those assets.

When should I use this instead of the native encoder or a trained adapter?

Keep the native encoder when matching the target model’s intended conditioning is more important than encoder flexibility. Try PlatoKeys when you need to reuse a different encoder without retraining and can evaluate the resulting images. Compared with training an adapter, the closed-form fit avoids gradient optimization, but its linear map cannot recover target features that are not predictably encoded in the source.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining Nynxz/ComfyUI-PlatoKeys? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature Nynxz/ComfyUI-PlatoKeys on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare