Compare commits

...
3 Commits
Author SHA1 Message Date
Ivor StrelarandClaude Opus 5.5 3f3d8581df feat: add SF WaveSpeed Tripo P2 Image to 3D node
Tripo P2 image-to-3D through WaveSpeed's API, for generating on a WaveSpeed
account rather than ComfyUI partner credits. The official WaveSpeed pack does
not surface it: the installed 2.0.0 fetches its model list from a catalog
endpoint that now returns 404.

Exposes quad topology, face_limit, texture quality (none/fast/standard/
detailed/extreme), PBR, texture version, delight, auto_size, export_uv,
export_orientation and seeds. Validates face_limit against Tripo's ranges
(48-50,000 triangles, 48-25,000 quads) and that 'fast' texture is paired with
v3.5, so bad combinations fail before they are billed.

Outputs mirror ComfyUI's own Tripo node: FILE_3D_GLB and FILE_3D_FBX, with
the one matching the returned format populated (FBX for quad, GLB otherwise),
so it feeds Preview 3D and Save 3D directly. The model is also downloaded to
output/3d/ and its path and URL returned as strings. Unused options are
omitted from the request rather than sent as null, per WaveSpeed's docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 16:17:05 +02:00
Ivor StrelarandClaude Opus 5 309aaf216b docs: give the README a front page that explains the pack
The README had grown by appending a section per node and opened with little
more than a one-line description, so a visitor landing on the repo could not
tell what the pack was for without scrolling through 44 WaveSpeed rows.

Adds an overview table of the four categories with node counts, and surfaces
the two things worth finding — the asset library workflow and the Google Sheet
prompt queue — above the fold with links into their sections.

Also fixes a broken table in Stillfront/LLM, where a blank line had orphaned
the SF Claude Library Builder row into a separate fragment that rendered as
stray text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-12 13:55:45 +02:00
Ivor StrelarandClaude Opus 5 59ebc14c5c feat: make library builder reruns incremental
Adding assets to a catalogued library used to mean re-describing every asset:
the checkpoint is deleted on success, and its key hashed the file list, so any
change invalidated it. Cataloguing five new assets cost the same as the whole
library.

The manifest itself is now the durable record of what is described. With the
new update_existing input (default on), a rerun loads the existing manifest,
reuses those descriptions, and only sends genuinely new files to Claude.
Entries whose file no longer exists are dropped. Turning it off re-describes
everything.

The checkpoint key no longer hashes the file list either, so adding an asset
mid-recovery does not discard an interrupted run's progress.

Not applied to organise-into-a-copy, where manifest paths are post-rename and
cannot be matched against a scan of the untouched source.

Verified with a stubbed CLI across four reruns: fresh library describes all 6,
an unchanged rerun describes 0, adding 3 describes only those 3, and deleting
2 describes 0 while dropping both from the manifest.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-12 11:22:52 +02:00
4 changed files with 373 additions and 18 deletions
+52 -5
View File
@@ -2,7 +2,32 @@
![Stillfront](assets/logo.png)
A collection of custom ComfyUI nodes developed by [Stillfront](https://www.stillfront.com). All nodes are prefixed with **SF** for easy searching in ComfyUI.
**63 custom ComfyUI nodes** from [Stillfront](https://www.stillfront.com), covering AI image and
video generation, LLM integration, and tooling for working with large game asset libraries. Every
node is prefixed **SF** so they're easy to find in the node search.
| | |
|---|---|
| [**Stillfront/WaveSpeed**](#stillfrontwavespeed) | 45 nodes — image, video and 3D generation through [WaveSpeed AI](https://wavespeed.ai): VEO 3.1, Sora 2, Nano Banana, Qwen, Flux Kontext, Seedream, WAN 2.5, InfiniteTalk, Tripo P2, upscalers |
| [**Stillfront/VertexAI**](#stillfrontvertexai) | 7 nodes — Imagen 3/4, VEO 3.1 and Nano Banana Pro via Google Cloud Vertex AI |
| [**Stillfront/Utils**](#stillfrontutils) | 7 nodes — Google Sheets integration, prompt batching, resolution presets |
| [**Stillfront/LLM**](#stillfrontllm) | 4 nodes — Claude, Gemini and GPT in your graph, plus the asset library tooling below |
### Worth a look
**[The asset library workflow](#the-asset-library-workflow)** — point Claude at a folder of game
assets and it writes a searchable manifest describing every one. After that, any workflow can ask
for *"the character art that suits a boss-fight poster"* and get back the right reference images
**plus a generated prompt that already matches your project's art style** — without a single image
being opened at generation time.
Two nodes do this: **SF Claude Library Builder** catalogues once, **SF Claude Asset Director**
searches on every run. Both run on your existing Claude Code login, so there's no API key and no
per-token billing.
**[SF Google Sheet Prompt Queue](#using-sf-google-sheet-prompt-queue)** — drive a batch of
generations straight from a Google Sheet, marking rows done as you go and resuming where you left
off.
---
@@ -61,7 +86,6 @@ Chat with large language models directly inside your ComfyUI workflows, with opt
| **SF Text Analyzer** | Analyze and process text strings within workflows. |
| **SF Claude Code** | Send text and images to Claude through the Claude Code CLI on your own machine, using your existing Claude login instead of an API key. Image slots appear as you fill them. |
| **SF Claude Asset Director** | Point Claude at an asset library and it chooses which references suit the brief and writes the image prompt to go with them. Outputs an IMAGE batch plus the prompt, ready to wire into any generation node. |
| **SF Claude Library Builder** | Point Claude at a folder of game assets and it writes a searchable manifest describing each one. Can also reorganise and rename the files. Feeds **SF Claude Asset Director**. |
#### The asset library workflow
@@ -130,9 +154,18 @@ blow up in turns and cost on libraries of 100+ assets, with nothing produced at
batch now only reads its own assets and replies with JSON; the node assembles and writes the
manifest itself, so no file-writing tool is ever handed to Claude for this.
A hidden checkpoint (`.sf_library_builder_checkpoint.json`, removed automatically on success)
tracks which assets are already catalogued. If a run fails or times out partway, rerunning with
the same settings **resumes** — finished batches are skipped, not re-paid for.
**Reruns are incremental.** With `update_existing` on (the default), the node reads the manifest
already in the library and only catalogues files it doesn't yet describe. So the normal workflow
is: drop new assets into the folder, run the same node against the same path, and only the new
ones cost anything. Entries whose file has since been deleted are dropped automatically. Turn
`update_existing` off to re-describe everything from scratch.
*(Not available in `organise into a copy` mode, where the manifest holds post-rename paths that
can't be matched against the untouched source folder.)*
Separately, a hidden checkpoint (`.sf_library_builder_checkpoint.json`, removed automatically on
success) covers a run that dies partway. Rerunning **resumes** — finished batches are skipped,
not re-paid for.
If a batch's reply comes back **cut off** — the model ran past its reply length limit partway
through describing a wordy set of assets — that batch is automatically **retried as two smaller
@@ -278,6 +311,20 @@ Connect an **SF WaveSpeed Client** node (enter your WaveSpeed API key) to any Wa
| **SF WaveSpeed Flux Kontext Max** | Flux Kontext Max — highest quality variant. |
| **SF WaveSpeed Flux ControlNet Union Pro 2** | Flux image generation with ControlNet guidance. |
#### 3D Generation
| Node | Description |
|---|---|
| **SF WaveSpeed Tripo P2 Image to 3D** | Tripo's P2 model — the same one behind ComfyUI's *Tripo P2: Image to Model* partner node — billed to your WaveSpeed account instead of ComfyUI credits. Quad or triangle topology, a target face count, texture quality from none to extreme, PBR, delighting, UVs, and seeds. |
Outputs mirror the partner node, so they plug into **Preview 3D** and **Save 3D** directly: Tripo
returns **FBX when `quad` is on and GLB when it's off**, so the matching output is populated and
the other is empty. The file is also saved to `output/3d/`, with its path and CDN URL as strings.
`face_limit` runs 48–50,000 for triangles or 48–25,000 for quads; `-1` lets Tripo decide. It's a
target, not a hard cap. Leave `export_orientation` unset if the model is headed for rigging or
retexturing — Tripo warns those steps can come out mis-rotated without reporting an error.
#### Upscalers
| Node | Description |
+85 -12
View File
@@ -89,21 +89,47 @@ def canonicalize(claude_path, expected):
return cleaned
def checkpoint_key(mode, manifest_name, system_prompt, project_notes, all_files):
"""A fingerprint of this exact job, so a checkpoint only resumes a matching rerun."""
def checkpoint_key(mode, manifest_name, system_prompt, project_notes):
"""A fingerprint of this job's settings, so a checkpoint only resumes a
matching rerun.
Deliberately excludes the file list: adding or removing an asset should not
throw away a half-finished run, and entries are keyed by path anyway, so
stale ones are filtered out when the manifest is assembled.
"""
payload = json.dumps(
{
"mode": mode,
"manifest_name": manifest_name,
"system_prompt": system_prompt,
"project_notes": project_notes,
"files": all_files,
},
sort_keys=True,
)
return hashlib.sha256(payload.encode("utf-8")).hexdigest()[:16]
def load_existing_manifest(path):
"""A previously written manifest, as (entries by file, project, art_style).
This is what makes a rerun incremental: anything already described here is
not sent to Claude again.
"""
if not os.path.isfile(path):
return {}, None, None
try:
with open(path, encoding="utf-8") as f:
data = json.load(f)
except (OSError, json.JSONDecodeError):
return {}, None, None
entries = {}
for entry in data.get("assets") or []:
if isinstance(entry, dict) and entry.get("file"):
entries[entry["file"]] = entry
return entries, data.get("project"), data.get("art_style")
def load_checkpoint(root, key):
path = os.path.join(root, CHECKPOINT_NAME)
if not os.path.isfile(path):
@@ -276,6 +302,18 @@ class SFClaudeLibraryBuilder:
),
},
),
"update_existing": (
"BOOLEAN",
{
"default": True,
"tooltip": (
"On: reuse descriptions already in the manifest and only "
"catalogue files that are new, so adding assets costs only "
"those assets. Entries whose file has since been deleted are "
"dropped. Off: describe every asset again from scratch."
),
},
),
"batch_size": (
"INT",
{
@@ -333,6 +371,10 @@ once, and tracks progress in a hidden checkpoint file. If a run fails partway,
rerunning with the same settings resumes from where it stopped instead of
re-paying for batches already done.
With **update_existing** on (the default), rerunning against a library that
already has a manifest only catalogues files that are new — so adding assets
costs just those assets. Entries whose file has since been deleted are dropped.
Defaults to **manifest only**, which touches nothing: you get the JSON as text to
read and save yourself. Switch `write_manifest` on to have it saved into the
library, or change `mode` to let Claude reorganise and rename the files too.
@@ -349,6 +391,7 @@ Budget about 5 seconds per asset — it opens every image.
system_prompt,
manifest_name,
write_manifest,
update_existing,
batch_size,
model,
timeout_seconds,
@@ -377,21 +420,51 @@ Budget about 5 seconds per asset — it opens every image.
if not assets:
raise ValueError(f"No image files found in {root}")
key = checkpoint_key(mode, manifest_name, system_prompt, project_notes, assets)
checkpoint = load_checkpoint(root, key)
manifest_root = out_dir if mode == MODE_COPY else root
manifest_path = os.path.join(manifest_root, manifest_name)
done_by_file = {}
project = art_style = None
# An existing manifest is the durable record of what is already described,
# so a rerun only pays for assets that are genuinely new. Skipped for the
# copy mode, where the manifest holds post-rename paths that cannot be
# matched against a scan of the untouched source folder.
reused = 0
if update_existing and mode != MODE_COPY:
existing, prev_project, prev_style = load_existing_manifest(manifest_path)
if existing:
done_by_file.update(existing)
project, art_style = prev_project, prev_style
reused = sum(1 for f in assets if f in existing)
gone = len(existing) - reused
print(
f"[SF Claude Library Builder] Found {manifest_name}: reusing "
f"{reused} existing description(s)"
+ (f", dropping {gone} for deleted file(s)" if gone else "")
+ "."
)
# A checkpoint from an interrupted run is newer than the manifest, so it wins.
key = checkpoint_key(mode, manifest_name, system_prompt, project_notes)
checkpoint = load_checkpoint(root, key)
if checkpoint:
project = checkpoint.get("project")
art_style = checkpoint.get("art_style")
for entry in checkpoint.get("done_assets", []):
if entry.get("file"):
done_by_file[entry["file"]] = entry
project = checkpoint.get("project") or project
art_style = checkpoint.get("art_style") or art_style
print(
f"[SF Claude Library Builder] Resuming — {len(done_by_file)}/{len(assets)} "
f"asset(s) already catalogued from a previous run."
f"[SF Claude Library Builder] Resuming an interrupted run — "
f"{len(done_by_file)}/{len(assets)} asset(s) already catalogued."
)
todo = sum(1 for f in assets if f not in done_by_file)
if todo == 0:
print("[SF Claude Library Builder] Nothing new to catalogue.")
else:
print(f"[SF Claude Library Builder] {todo} asset(s) to catalogue.")
# Claude only ever reads images and replies with JSON; the node writes the
# manifest itself, and the Write tool is never offered. Bash is needed
# only to move/rename files in the organise modes.
@@ -534,8 +607,6 @@ Budget about 5 seconds per asset — it opens every image.
}
manifest_text = json.dumps(manifest_data, indent=2)
manifest_root = out_dir if mode == MODE_COPY else root
manifest_path = os.path.join(manifest_root, manifest_name)
if write_manifest:
os.makedirs(manifest_root, exist_ok=True)
with open(manifest_path, "w", encoding="utf-8") as f:
@@ -547,11 +618,13 @@ Budget about 5 seconds per asset — it opens every image.
for entry in final_assets:
counts[entry.get("category", "?")] = counts.get(entry.get("category", "?"), 0) + 1
newly_done = max(0, len(final_assets) - reused)
report = "\n".join(
[
f"mode: {mode}",
f"scanned: {len(assets)} file(s) in {root}",
f"catalogued: {len(final_assets)} asset(s) across {len(batches)} batch(es)",
f"in manifest: {len(final_assets)} asset(s)",
f"reused: {reused} already described, {newly_done} newly catalogued",
"categories: " + (", ".join(f"{k} x{v}" for k, v in sorted(counts.items())) or "none"),
f"art style: {manifest_data['art_style'] or '(not set)'}",
"manifest: " + (manifest_path if write_manifest else "returned as text, not saved"),
+235
View File
@@ -0,0 +1,235 @@
# ABOUTME: Tripo P2 image-to-3D through the WaveSpeed API, billed to a WaveSpeed account
# ABOUTME: Emits GLB/FBX File3D outputs compatible with ComfyUI's Preview 3D and Save nodes
import os
import time
from urllib.parse import urlparse
import requests
from .wavespeed_api.client import WaveSpeedClient
from .wavespeed_api.utils import tensor2images
try:
from comfy_api.latest import Types
File3D = Types.File3D
except ImportError: # older ComfyUI without 3D file types
File3D = None
ENDPOINT = "/api/v3/tripo3d/p2/image-to-3d"
RESULT_PATH = "/api/v3/predictions/{id}/result"
TEXTURE_LEVELS = ["standard", "fast", "detailed", "extreme", "none"]
TEXTURE_VERSIONS = ["v3.5-20260815", "v3.0-20250812", "v2.5-20250123"]
ORIENTATION_UNSET = "unset (recommended)"
ORIENTATIONS = [ORIENTATION_UNSET, "+x", "-x", "+y", "-y"]
TERMINAL_FAILURES = {"failed", "cancelled", "timeout", "deleted"}
def build_payload(image_url, quad, face_limit, texture, pbr, texture_version,
delight, auto_size, export_uv, export_orientation, model_seed, texture_seed):
"""The request body. Unused options are omitted rather than sent as null,
as WaveSpeed's documentation asks."""
if face_limit != -1:
ceiling = 25000 if quad else 50000
if not 48 <= face_limit <= ceiling:
raise ValueError(
f"face_limit must be -1 (adaptive) or between 48 and {ceiling}"
f"{' — quad meshes cap at 25,000' if quad else ''}."
)
if texture == "fast" and texture_version != "v3.5-20260815":
raise ValueError("texture 'fast' requires texture_version v3.5-20260815.")
textured = texture != "none"
payload = {
"image": image_url,
"quad": quad,
"texture": textured,
# PBR implies textures, so it is switched off along with them.
"pbr": bool(pbr and textured),
"auto_size": auto_size,
"export_uv": export_uv,
}
if textured:
payload["texture_quality"] = texture
payload["texture_version"] = texture_version
payload["delight"] = delight
if face_limit != -1:
payload["face_limit"] = face_limit
if export_orientation != ORIENTATION_UNSET:
payload["export_orientation"] = export_orientation
if model_seed != -1:
payload["model_seed"] = model_seed
if texture_seed != -1 and textured:
payload["texture_seed"] = texture_seed
return payload
def pick_model_url(outputs):
"""The model file URL out of a result's `outputs`, which may be a list or a string."""
candidates = outputs if isinstance(outputs, list) else [outputs]
urls = [u for u in candidates if isinstance(u, str) and u.startswith("http")]
for url in urls:
if urlparse(url).path.lower().endswith((".glb", ".fbx")):
return url
if urls:
return urls[0]
raise RuntimeError(f"No model URL in the result: {outputs!r}")
def check_interrupted():
try:
import comfy.model_management as mm
except ImportError:
return
mm.throw_exception_if_processing_interrupted()
def output_dir():
try:
import folder_paths
base = folder_paths.get_output_directory()
except ImportError:
base = os.getcwd()
path = os.path.join(base, "3d")
os.makedirs(path, exist_ok=True)
return path
class SFWaveSpeedTripoP2ImageTo3D:
"""
Tripo P2 image-to-3D via WaveSpeed — the same model as ComfyUI's partner
node, billed to your WaveSpeed account instead of ComfyUI credits.
Tripo returns FBX when quad topology is on and GLB when it is off, so the
matching output is populated and the other is empty.
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"client": ("WAVESPEED_AI_API_CLIENT",),
"image": ("IMAGE", {"tooltip": "Reference image. Only the first frame of a batch is used."}),
"quad": (
"BOOLEAN",
{"default": False, "tooltip": "Quad topology instead of triangles. Output becomes FBX."},
),
"face_limit": (
"INT",
{
"default": -1,
"min": -1,
"max": 50000,
"step": 100,
"tooltip": "Target face count. -1 lets Tripo choose. 48-50,000, or up to 25,000 with quad.",
},
),
"texture": (
TEXTURE_LEVELS,
{"default": "standard", "tooltip": "'none' gives untextured geometry. Higher levels cost more."},
),
"pbr": ("BOOLEAN", {"default": True, "tooltip": "PBR material maps. Ignored when texture is 'none'."}),
},
"optional": {
"texture_version": (
TEXTURE_VERSIONS,
{"default": TEXTURE_VERSIONS[0], "tooltip": "'fast' texture requires v3.5."},
),
"delight": (
"BOOLEAN",
{"default": True, "tooltip": "Strip lighting baked into the source image before texturing."},
),
"auto_size": ("BOOLEAN", {"default": False, "tooltip": "Scale the model to real-world metres."}),
"export_uv": ("BOOLEAN", {"default": True, "tooltip": "Generate UVs. Off is faster and smaller."}),
"export_orientation": (
ORIENTATIONS,
{
"default": ORIENTATION_UNSET,
"tooltip": (
"Forward axis. Leave unset if you will rig, retexture or convert the "
"model — Tripo warns those steps can silently come out mis-rotated."
),
},
),
"model_seed": (
"INT",
{"default": -1, "min": -1, "max": 2147483647, "tooltip": "-1 for random geometry."},
),
"texture_seed": (
"INT",
{"default": -1, "min": -1, "max": 2147483647, "tooltip": "-1 for random texturing."},
),
"timeout_seconds": (
"INT",
{"default": 900, "min": 60, "max": 3600, "step": 30},
),
},
}
RETURN_TYPES = ("FILE_3D_GLB", "FILE_3D_FBX", "STRING", "STRING")
RETURN_NAMES = ("GLB", "FBX", "model_file", "model_url")
OUTPUT_TOOLTIPS = (
"Populated when quad is off.",
"Populated when quad is on.",
"Absolute path of the downloaded model in ComfyUI's output/3d folder.",
"WaveSpeed CDN link to the model.",
)
FUNCTION = "generate"
CATEGORY = "Stillfront/WaveSpeed"
OUTPUT_NODE = True
def generate(self, client, image, quad, face_limit, texture, pbr,
texture_version=TEXTURE_VERSIONS[0], delight=True, auto_size=False,
export_uv=True, export_orientation=ORIENTATION_UNSET,
model_seed=-1, texture_seed=-1, timeout_seconds=900):
api = WaveSpeedClient(api_key=client["api_key"])
image_url = api.upload_file(tensor2images(image)[0])
payload = build_payload(
image_url, quad, face_limit, texture, pbr, texture_version, delight,
auto_size, export_uv, export_orientation, model_seed, texture_seed,
)
task = api.post(ENDPOINT, payload)
task_id = task.get("id")
if not task_id:
raise RuntimeError(f"WaveSpeed did not return a task id: {task}")
print(f"[SF Tripo P2] Submitted {task_id} (quad={quad}, faces={face_limit}, texture={texture}).")
started = time.time()
while True:
check_interrupted()
result = api.get(RESULT_PATH.format(id=task_id))
status = result.get("status")
if status == "completed":
break
if status in TERMINAL_FAILURES:
raise RuntimeError(f"Tripo P2 task {status}: {result.get('error') or result}")
if time.time() - started > timeout_seconds:
raise RuntimeError(f"Tripo P2 task {task_id} still '{status}' after {timeout_seconds}s.")
time.sleep(3)
url = pick_model_url(result.get("outputs"))
ext = os.path.splitext(urlparse(url).path)[1].lower() or (".fbx" if quad else ".glb")
path = os.path.join(output_dir(), f"sf_tripo_p2_{task_id}{ext}")
response = requests.get(url, timeout=300)
response.raise_for_status()
with open(path, "wb") as f:
f.write(response.content)
print(f"[SF Tripo P2] Done in {time.time() - started:.0f}s -> {path}")
glb = fbx = None
if File3D is not None:
model = File3D(path)
glb = model if ext == ".glb" else None
fbx = model if ext == ".fbx" else None
return (glb, fbx, path, url)
NODE_CLASS_MAPPINGS = {"SFWaveSpeedTripoP2ImageTo3D": SFWaveSpeedTripoP2ImageTo3D}
NODE_DISPLAY_NAME_MAPPINGS = {"SFWaveSpeedTripoP2ImageTo3D": "SF WaveSpeed Tripo P2 Image to 3D"}
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-sf-nodes"
description = "Custom nodes for ComfyUI including LLM Chat with support for Claude, Gemini, and OpenAI models, WaveSpeed AI image/video generation, VertexAI integration, and workflow utilities"
version = "1.3.2"
version = "1.5.0"
license = { file = "LICENSE" }
dependencies = [
"requests>=2.31.0",