From 0829dfd33623622be6db3c0aed25b17bf02962e4 Mon Sep 17 00:00:00 2001 From: limbicnation Date: Fri, 27 Feb 2026 06:10:03 +0100 Subject: [PATCH] fix: address code review findings for style system consolidation --- CLAUDE.md | 2 +- __init__.py | 2 +- nodes/prompt_generator_node.py | 6 ++++-- nodes/style_applier_node.py | 8 +++++--- pyproject.toml | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 549f568..eb58a24 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ComfyUI custom node that generates Stable Diffusion prompts using Ollama. Users provide a brief description and select a style preset; the node outputs a detailed, optimized prompt. Supports LoRA-enhanced models with automatic discovery and prioritization. -**Current version**: `1.1.6` +**Current version**: `1.1.7` ## Architecture diff --git a/__init__.py b/__init__.py index ebf4ba7..ea35a91 100644 --- a/__init__.py +++ b/__init__.py @@ -13,7 +13,7 @@ NODE_CLASS_MAPPINGS = { NODE_DISPLAY_NAME_MAPPINGS = { "PromptGenerator": "🎨 Prompt Generator (Qwen)", - "StyleApplier": "🎬 Style Applier (Cinematic/Photo)", + "StyleApplier": "🎬 Style Applier", } __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] diff --git a/nodes/prompt_generator_node.py b/nodes/prompt_generator_node.py index 9eb81fa..236b493 100644 --- a/nodes/prompt_generator_node.py +++ b/nodes/prompt_generator_node.py @@ -294,8 +294,10 @@ Format the response as a single, detailed photography prompt.""", templates = yaml.safe_load(f) if templates: return list(templates.keys()) - except Exception: - pass + except Exception as e: + print( + f"[PromptGenerator] Warning: Failed to load style list from templates.yaml: {e}" + ) return list(cls.DEFAULT_STYLES.keys()) @classmethod diff --git a/nodes/style_applier_node.py b/nodes/style_applier_node.py index a2664bc..0438e7f 100644 --- a/nodes/style_applier_node.py +++ b/nodes/style_applier_node.py @@ -1,6 +1,6 @@ """ Style Applier Node for ComfyUI -Applies Cinematic or Still Image style keywords to prompts. +Applies style keywords to prompts using the shared StylePreset system (9 styles). """ from typing import Tuple @@ -8,11 +8,13 @@ from typing import Tuple class StyleApplierNode: """ - ComfyUI node for applying Cinematic or Still Image style keywords to prompts. + ComfyUI node for applying style keywords to prompts. + + Uses the shared StylePreset system with 9 available styles. Inputs: - prompt: Base prompt text - - style: "cinematic" or "still_image" + - style: One of 9 style presets (e.g. "cinematic", "anime", "cyberpunk") - position: Where to add keywords ("prefix", "suffix", or "wrap") - emphasis: Optional emphasis level ("low", "medium", "high") - include_technical: Include camera/technical specs diff --git a/pyproject.toml b/pyproject.toml index 5ed22e2..d95dc5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-prompt-generator" -description = "Generate Stable Diffusion prompts using Qwen3-8B via Ollama with 7 style presets" -version = "1.1.6" +description = "Generate Stable Diffusion prompts using Qwen3-8B via Ollama with 9 style presets" +version = "1.1.7" license = {file = "LICENSE"} readme = "README.md" requires-python = ">=3.10"