Files
Claude 59f11da248 Fix broken nodes, modernize Gemini nodes, and speed up loading
Bug fixes:
- FilterImages used imghdr, which was removed in Python 3.13; the import
  failure stopped the whole pack from loading. Now uses Pillow, and returns
  a newline-joined string instead of a list on a STRING output.
- Dynamic Conditioning / Dynamic Image Switch crashed with no inputs
  (unbound variable).
- Dynamic Start Index never advanced because ComfyUI cached its output;
  added IS_CHANGED. Same for Load Batch From Dir increment/random modes.
- Dynamic Delay Text always output "" (its timer result went nowhere);
  Collect and Distribute Text had the same timer problem.
- People Evaluation Node returned a bare string on errors and printed the
  whole prompt to the console.
- Raw latent saver/loader only worked for 1x4x128x128 latents. Now saves
  safetensors (same layout as ComfyUI's Save Latent) and still reads old files.
- web/index.js imported the appearance script with the wrong filename case
  (breaks on Linux/macOS); the console test script was auto-loaded on every
  page load and now lives in tools/.
- Workflow chaining used a hardcoded port 8188, and gives a clear error for
  UI-format (non-API) workflow files.

Gemini:
- Shared helper for both Gemini nodes; key config now defaults to the
  bundled assets/scripts/api_keys_config.json (paths relative to it), plus
  GEMINI_API_KEY env var support.
- "disable" thinking now actually disables it on 2.5 Flash, so thinking no
  longer eats max_output_tokens and returns empty text; "enable" uses the
  previously unused DEFAULT_THINKING_BUDGET.
- Seed is passed to the API; empty/blocked responses report why.
- Retired 2.0/preview models replaced; custom_model field for new models.
- Audio WAV encoding no longer depends on torchaudio's save backend.

Optimizations:
- Index switches (model/VAE/CLIP/text) use lazy inputs, so only the
  selected branch is evaluated.
- __init__ loads modules in a loop and isolates failures per module.
- Prompt nodes share one implementation, read prompt files at run time and
  re-run when the file changes (no restart needed).
- LoRA dropdowns use ComfyUI's cached file list and refresh without a
  restart; LoRA lookup searches all LoRA folders; hashing uses 1 MB chunks;
  DB writes are atomic.
- Load Batch Images concatenates once instead of per image.
- Custom Node Manager parses files instead of executing them.
- requirements.txt drops unused pins (importlib_metadata, packaging,
  opencv-python, sounddevice, standard-imghdr).

Version 2.10.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Lm4YDXhwj49hAA1RKS58Q
2026-10-22 11:42:48 +00:00

67 lines
2.6 KiB
JavaScript

import { app } from "../../../../scripts/app.js";
// Extension to apply custom colors to all StarNodes
app.registerExtension({
name: "Creepynodes.appearance",
async setup() {
// This runs once when the extension is loaded
console.log("Creepynodes appearance extension setup");
},
async beforeRegisterNodeDef(nodeType, nodeData) {
// Check if this is a StarNode by looking at the category
if (nodeData.category && nodeData.category.startsWith("Creepybits")) {
// Define our colors
const backgroundColor = "#0b500b"; // Purple background
const titleColor = "#500b50"; // Dark blue title
const textColor = "#500b50"; // Dark blue text (was white)
// Store the original onNodeCreated function
const onNodeCreated = nodeType.prototype.onNodeCreated;
// Override the onNodeCreated function
nodeType.prototype.onNodeCreated = function() {
// Call the original onNodeCreated if it exists
if (onNodeCreated) {
onNodeCreated.apply(this, arguments);
}
// Apply custom colors
this.bgcolor = backgroundColor;
this.color = textColor;
// Store the original drawTitleBar function
const originalDrawTitleBar = this.drawTitleBar;
// Newer ComfyUI frontends no longer have drawTitleBar; the colors above still apply.
if (typeof originalDrawTitleBar !== "function") {
return;
}
// Override the drawTitleBar function to use our custom title color
this.drawTitleBar = function(ctx, title_height) {
// Call the original function first
originalDrawTitleBar.call(this, ctx, title_height);
// Draw the title text with our custom color
if (this.flags.collapsed) {
return;
}
ctx.font = this.title_font || LiteGraph.DEFAULT_TITLE_FONT;
const title = this.getTitle();
if (title) {
// Save context
ctx.save();
// Set our custom title color
ctx.fillStyle = titleColor;
// Draw the title text
ctx.fillText(title, 10, title_height * 0.75);
// Restore context
ctx.restore();
}
};
};
}
}
});