Skip to content

Releases: jeremieLouvaert/ComfyUI-API-Optimizer

v1.2.2 -- image-only sample uses Style Transfer Settings node

19 Apr 06:43

Choose a tag to compare

What changed

Rewrote workflows/hash_vault_image_only.json to use the new Gemini Style Transfer Settings node (shipped in ComfyUI-Gemini-Direct v1.1.0) in place of the two StringConstantMultiline nodes that v1.2.1 used.

Why

The v1.2.1 sample required converting Style Transfer's style and intensity dropdowns to inputs and driving them with text nodes. Functionally correct, but a typo in the style name would silently produce a hash for an invalid style that Style Transfer then errored on at runtime. The Settings node owns both dropdowns natively, so the wired value is always a known-valid option and caching stays reliable.

Requires

  • ComfyUI-Gemini-Direct v1.1.0 or newer for the Settings node
  • ComfyUI-API-Optimizer v1.2.0 or newer for Hash Vault's optional payload_string and any_input_2/3/4 slots

No code changes to the cache engine. Back-compat is bit-identical with v1.2.0 and v1.2.1.

v1.2.1 — image-only Hash Vault sample workflow

19 Apr 06:25

Choose a tag to compare

Added

  • workflows/hash_vault_image_only.json — demonstrates the v1.2.0 image+widgets pattern using Gemini Style Transfer (image, style dropdown, intensity dropdown, no prompt). Style and intensity widgets are converted to inputs and driven by StringConstantMultiline nodes that also feed Hash Vault's any_input_2 and any_input_3. The image fans out to both Style Transfer and Hash Vault's any_input. All three factor into the cache key.

Updated

  • README split into two example sections — prompt-driven (Gemini Image Generate) and image-only (Gemini Style Transfer) — so new users land on the pattern that matches their API node.

This is a patch release with no node code changes; the bump is to retrigger the Comfy Registry publish so installed copies receive the new workflow file.

v1.2.0 — Hash Vault: optional payload_string + 4 any-type slots

18 Apr 19:02

Choose a tag to compare

What changed

Hash Vault (Check Cache) now has the following signature:

  • payload_stringoptional (was required). Drop your prompt / JSON params here if you have one, leave empty otherwise.
  • any_input — unchanged. Existing workflows keep hitting their existing cache entries.
  • any_input_2, any_input_3, any_input_4new. Route converted widgets or additional inputs here.

Primary use case

Image-only APIs with meaningful widgets but no prompt string — e.g. Gemini Style Transfer, which has (image, style dropdown, strength float) and no natural STRING input.

Right-click the style and strength widgets on your API node → Convert Widget to Input. Wire:

  • image → any_input
  • style → any_input_2
  • strength → any_input_3

All three factor into the cache key. Change any of them → new hash → cache miss → API runs. Same combination → cache hit → API is skipped entirely via the Lazy API Switch.

Back-compat

Workflows that only use payload_string + any_input produce bit-identical hash keys to v1.0/v1.1. The __slotN: prefix is only written when slots 2–4 are actually wired, so existing output/hash_vault/ entries keep hitting. Verified directly against the pre-v1.2 hashing path.

v1.1.0 — Hash Vault sample workflow

18 Apr 18:43

Choose a tag to compare

Added

  • workflows/hash_vault_basic.json — ready-to-run wiring of the canonical cache-skip pattern. Drag it into ComfyUI, set your Gemini API key (or swap in any other API generator), press Queue twice: first run generates and caches, second run with the same prompt returns the cached image with zero API call.

How the sample wires up

StringConstantMultiline ──┬──► DeterministicHashVault ──┬──► LazyAPISwitch ──► PreviewImage
                          │            │                 │          ▲
                          │            ├─(hash_key)──┐   │          │
                          │            └─(is_cached)─┼───┘          │
                          │                          ▼              │
                          └──► GeminiImageGenerate ──► HashVaultSave ┘

One string source feeds both Hash Vault (hashed for cache lookup) and Gemini (as the actual prompt). LazyAPISwitch reads is_cached and demands either cached_data (skipping Gemini entirely) or api_data (running Gemini + HashVaultSave).

Requires

v1.0.0 - API Cost & Cache Optimization

31 Mar 12:09

Choose a tag to compare

Production-grade ComfyUI nodes for optimizing external API workflows.

  • API Cost & Quota Tracker: circuit-breaker for cloud API spending
  • Deterministic Hash Vault: aggressive disk-caching layer
  • Lazy API Switch: prevents upstream API execution on cache hits
  • Supports Kling, Magnific, Banana.dev, RunPod, and any REST API