Skip to content

Commit cdca925

Browse files
Add image-only Hash Vault sample workflow, v1.2.1
workflows/hash_vault_image_only.json demonstrates the v1.2.0 image+ widgets pattern: Gemini Style Transfer (image, style, intensity, no prompt). The style and intensity widgets are converted to inputs and driven by two StringConstantMultiline nodes that ALSO feed Hash Vault's any_input_2 / any_input_3. The image fans out to both Style Transfer and Hash Vault's any_input. README split into two examples (prompt-driven vs image-only) so new users can pick the pattern that matches their API node. Patch bump to retrigger the Comfy Registry publish so installed copies pick up the new workflow file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 06265fd commit cdca925

3 files changed

Lines changed: 688 additions & 7 deletions

File tree

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,19 @@ Any subset of slots works; unused slots contribute nothing to the hash. Adding o
6565
│ cached_data ────────────────────┘
6666
```
6767

68-
## Example Workflow
68+
## Example Workflows
6969

70-
A ready-to-run wiring is in [`workflows/hash_vault_basic.json`](workflows/hash_vault_basic.json). Drag it into ComfyUI, set your Gemini API key (or swap the Gemini node for any other API generator), press Queue Prompt twice:
70+
### Prompt-driven API — [`workflows/hash_vault_basic.json`](workflows/hash_vault_basic.json)
7171

72-
1. **First run** — Hash Vault reports a miss, Gemini generates, Save writes `output/hash_vault/<hash>.pt`.
73-
2. **Second run (same prompt)** — Hash Vault reports a hit, Lazy Switch short-circuits the Gemini branch entirely, the cached image displays. No API call, no cost.
72+
The classic pattern for an API node whose uniqueness lives in a prompt STRING (e.g. Gemini Image Generate). One `StringConstantMultiline` feeds both Hash Vault's `payload_string` and the API node's prompt. Drag it in, set your Gemini API key, press Queue twice: first run generates and caches, second run returns the cached image with zero API call.
7473

75-
Change the prompt, queue again — new hash, new miss, new API call. Re-run the old prompt — still cached, still free.
74+
### Image-only API with widget inputs — [`workflows/hash_vault_image_only.json`](workflows/hash_vault_image_only.json)
7675

77-
The workflow uses [ComfyUI-KJNodes](https://github.com/kijai/ComfyUI-KJNodes)'s `StringConstantMultiline` as the shared prompt source. Any STRING primitive works in its place; the key is that one source drives both Hash Vault and the API node so they hash the same input.
76+
Shows the v1.2.0 pattern for an API that has no prompt STRING but does have meaningful widgets — Gemini Style Transfer (image + style dropdown + intensity dropdown). The style and intensity widgets on the Style Transfer node are converted to inputs and driven by two `StringConstantMultiline` nodes, which also feed Hash Vault's `any_input_2` and `any_input_3`. The image fans out to Style Transfer AND Hash Vault's `any_input`. All three factor into the hash; change any one of them → new cache key → API runs once.
77+
78+
### Requires
79+
80+
Both workflows use [ComfyUI-Gemini-Direct](https://github.com/jeremieLouvaert/ComfyUI-Gemini-Direct) as the API node and [ComfyUI-KJNodes](https://github.com/kijai/ComfyUI-KJNodes)'s `StringConstantMultiline` as the value source. Any STRING primitive works in place of KJNodes'; the point is that one source drives both the API node and Hash Vault so they see identical inputs.
7881

7982
## Output Files
8083

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-api-optimizer"
33
description = "API cost tracking, deterministic hash caching, and lazy execution bypass for cloud API workflows"
4-
version = "1.2.0"
4+
version = "1.2.1"
55
license = { file = "LICENSE" }
66

77
[project.urls]

0 commit comments

Comments
 (0)