20 Commits
Author SHA1 Message Date
slahiriandClaude Opus 4.5 5bfd23187a feat: add caching to PromptGenerator based on seed and inputs
- Add class-level cache dictionary to store prompt/caption results
- Add _build_cache_key() method that hashes image data + all parameters
- Use sampled pixels for efficient image hashing of large images
- Return cached results when seed and all inputs match
- Print cache hit/miss messages for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:39:04 +05:30
slahiriandClaude Opus 4.5 88bb7ad1e2 feat: add caching to PromptModifier based on seed and inputs
- Add class-level cache dictionary for prompt/caption results
- Build cache key from all inputs (prompt, seed, mode, instructions, presets, model)
- Return cached results immediately if cache hit (no LLM call)
- Store results in cache after generation
- Changing seed will bypass cache and regenerate
- Same seed + same inputs = instant cached result

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:35:10 +05:30
slahiriandClaude Opus 4.5 dcfd7fd6c9 feat: add Expand mode to PromptModifier for generating detailed prompts
- Add "Expand" as new processing mode option (before Single Pass, Section by Section)
- Create _expand_prompt method that generates detailed prompts from basic text
- Expansion follows Z-Image structure: subject, clothing, pose, environment, lighting, camera
- Photography templates, effects, and styles are incorporated during expansion
- After expansion, any section instructions are applied as modifications
- Useful for creating detailed prompts without a source image

Usage: Set processing_mode to "Expand", enter basic text like "woman in red dress, beach sunset"
The LLM will generate a comprehensive 200-400 word detailed prompt.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:27:12 +05:30
slahiriandClaude Opus 4.5 aac6274fbe fix: remove hard word limits, keep only repetition detection
- Remove hard word count limits (was 800 words) from all local clients
- Truncation now only occurs for actual repetition patterns
- Increase min tokens to 1500 and default max to 6000 for prompt modification
- Add token calculation logging for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:14:46 +05:30
slahiriandClaude Opus 4.5 bd3ceaa1e1 feat: add interrupt handling, increase token limits, add analysis report
Interrupt Handling:
- Add check_interrupt() using ComfyUI's throw_exception_if_processing_interrupted
- Nodes now properly stop when user clicks cancel button

Token/Word Limits (prevent truncation):
- Increase word limits from 400-500 to 800 words in all local clients
- Increase token buffer from 30% to 50% in PromptModifier
- Increase min tokens from 500 to 800 for prompt modification
- Increase default max_tokens from 2000 to 4000

PromptModifier Analysis Report:
- Add console report comparing original vs modified prompts
- Show word count changes and semantic differences
- Verify if requested modifications were applied

PromptGenerator:
- Remove prompt_metadata from outputs (was 3rd output)
- Save metadata to logs/prompt_generator/ folder
- Add logs/ to .gitignore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 10:12:21 +05:30
slahiriandClaude Opus 4.5 435c2bb24d fix: filter Qwen3 <think> blocks and add seed/dynamic tokens
- Filter out <think>...</think> reasoning blocks from Qwen3 output
- Handle incomplete think blocks (model didn't close tag)
- Add seed field to SID_PromptGenerator and SID_PromptModifier
- Add dynamic max_tokens calculation based on input size + 30%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:41:36 +05:30
slahiriandClaude Opus 4.5 e2b14e7c13 feat: add seed field and dynamic token calculation
- Add seed input to SID_PromptGenerator and SID_PromptModifier
  for reproducibility (change seed to force re-generation)
- Add dynamic max_tokens calculation in PromptModifier:
  - Estimates tokens from input prompt length
  - Adds 30% buffer for modifications
  - Clamps between 500 and model's max_tokens

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:37:40 +05:30
slahiriandClaude Opus 4.5 28d74114a6 fix: prevent runaway local LLM generation with repetition penalty and truncation
- Add repetition_penalty (1.2-1.3) and top_p params to all local model clients
- Add _truncate_runaway() to detect and cut off repetitive output:
  - Character repetition (10+ same chars)
  - Phrase repetition (5+ consecutive n-grams)
  - Hard word limit safety net (400-500 words)
- Pass repetition_penalty/top_p from extra_params in all mode files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:28:35 +05:30
slahiriandClaude Opus 4.5 03fb2b8f4e feat: add release_vram toggle to PromptModifier (default: enabled)
- Added release_vram boolean toggle (default True)
- Clears GPU memory and runs garbage collection after execution
- Frees VRAM for subsequent nodes in workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:20:17 +05:30
slahiriandClaude Opus 4.5 295553e326 feat: add photography templates, effects, and photographer styles to PromptModifier
New dropdown options:
- Photography Templates (16): Studio Portrait, Fashion Editorial, Boudoir, Cinematic, etc.
- Photography Effects (18): Film Grain, Bokeh, Teal and Orange, Black and White, etc.
- Photographer Styles (20): Annie Leibovitz, Peter Lindbergh, Helmut Newton, etc.

Presets are integrated naturally with section modifications.
Single Pass applies all at once, Section by Section applies presets first then sections.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:18:38 +05:30
slahiriandClaude Opus 4.5 426dd358d5 fix: use LLM node temperature in PromptModifier, prompt as input only
- Removed temperature parameter from SID_PromptModifier
- Now uses temperature from connected LLM node (llm_model.temperature)
- Changed prompt input to forceInput (connection only, no text box)
- Added .cache/ and .claude/ to .gitignore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:13:07 +05:30
slahiriandClaude Opus 4.5 5d914f7e01 feat: add SID_LLM_Local_Text node for text-only local models
New node for text-only Qwen models (no vision):
- Qwen2.5 series: 1.5B, 3B, 7B, 14B
- Qwen3 series: 1.7B, 4B, 8B
- Abliterated (uncensored): 7B, 14B

Features:
- VRAM-efficient text-only inference
- 4-bit, 8-bit, FP16 quantization
- Model caching for fast repeated calls
- OpenAI-compatible interface

Updated SID_PromptModifier to support local_text provider.
Ideal for prompt modification workflows without vision.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 08:52:18 +05:30
slahiriandClaude Opus 4.5 0dfd6fd294 feat: add SID_PromptModifier node for semantic prompt modification
New node that modifies prompts based on Z-Image structure:
- Takes input prompt and LLM model
- 6 section instruction inputs: subject, clothing, pose, environment, lighting, camera
- Two processing modes: Single Pass (faster) and Section by Section (precise)
- Temperature control for LLM creativity
- Optional Instagram caption generation (3 styles)
- Text-only LLM calls (no image required)

Phase 1 implementation using LLM API.
Phase 2 will add SID_LLM_Local_Text support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 08:44:59 +05:30
slahiriandClaude Opus 4.5 4361a7b403 feat: add Instagram caption generation and yellow node colors
Caption Generation:
- Added generate_caption toggle to SID_PromptGenerator
- New caption output with 3 styles: Poetic, Technical, Personal
- Each style includes caption, description, and hashtags
- Uses same LLM as prompt generation

Node Colors:
- Added web/js/sid_node_colors.js for yellow node theming
- All SID_ nodes now display with standard ComfyUI yellow swatch
- Added WEB_DIRECTORY export to load JS extensions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 08:28:43 +05:30
slahiriandClaude Opus 4.5 2fb79e2a15 fix: align detailed mode system prompt with standard/quick modes
Changed final instruction from "Be comprehensive and precise" to
"Write as a single flowing paragraph. Be precise and literal."
for consistency across all modes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:53:46 +05:30
slahiriandClaude Opus 4.5 a78ebb3b00 feat: add fashion pose detection with body/face angle analysis
Fashion poses detected:
- Contrapposto (S-curve)
- Hand on hip
- Power pose (wide stance)
- Crossed legs
- Walking/runway
- Over shoulder look
- Leaning
- Arms crossed
- Weight shift
- Hands behind back

Body/face orientation:
- Facing camera vs side vs angled (3/4 view)
- Body turn direction (left/right)
- Face turn direction (looking left/right)
- Back to camera detection

Integration:
- Fashion poses extracted from DWPose keypoints
- Pose info injected into LLM prompts
- Detailed pose output in runner console

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:24:08 +05:30
slahiriandClaude Opus 4.5 274b36a620 fix: improve pose detection with proper keypoint extraction
- Fix DWPose/OpenPose to extract actual keypoints instead of just "detected: True"
- Improve pose analysis with better standing/sitting/lying/kneeling detection
- Add arm position detection (raised, extended, neutral)
- Add hand near face detection
- Track visible body parts (shoulders, hips, knees, ankles)
- Better pose type confidence scoring
- Enhanced pose output in runner with detailed keypoint info

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:15:14 +05:30
slahiriandClaude Opus 4.5 474b02a021 feat: Z-Image/Flux prompts, female anatomy injection, detailed mode for all LLMs
Changes:
- Update system prompts for Z-Image/Flux with concrete visual descriptions
- Add CRITICAL RULES to exclude poetic/philosophical/abstract language
- Add female anatomy tags injection for women subjects (NudeNet workaround)
- Remove reasoning requirement from detailed mode - works on all LLMs now
- Detailed mode uses extended thinking only when available (Anthropic API)
- Fix Decisions attribute names (wildlife_type, weather_condition, landmark_name)
- Fix get_tag_enhancement/get_clothing_prompt function signatures
- Fix NudeNet detection display (class/score vs label/confidence keys)
- Add local model support to detailed mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:10:10 +05:30
slahiriandClaude Opus 4.5 031f316b4b fix: remove hardcoded limits and add max_injected_tags parameter
Changes:
- Use llm_model.max_tokens instead of hardcoded 8000/4000 in detailed.py
- Add max_injected_tags node input (default 30, range 5-100)
- Remove enhancement limits (was [:3] per section, [:5] clothing)
- Remove Extreme mode from analysis_mode options
- Pass tag_threshold and max_injected_tags through entire pipeline

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 00:37:10 +05:30
slahiriandClaude Opus 4.5 0012ad531b feat: v4.2.1 - Modular prompt generator with enhanced LLM modes
Major Features:
- New modular prompt generator architecture (core/prompt_generator/)
- 15+ taggers/analyzers: WD14, PixAI, JoyTag, NudeNet, Places365, etc.
- Decision engine for intelligent prompt construction
- Template-based prompt building with dynamic sections

Standard Mode Enhancements:
- Tag injection for unmapped high-confidence tags
- Scene-specific prompts (20 scene groups from Places365)
- Animal-specific prompts (20+ animal types)
- Clothing-specific prompts (30+ clothing types)
- Tag-driven detail enhancements (40+ tag mappings)
- Semantic inclusion analysis using sentence-transformers

Detailed Mode (API with reasoning):
- 3-pass LLM generation with full enhancements
- Falls back to Standard mode for local models
- Comprehensive metadata with pass-by-pass details

Removed:
- Extreme mode (consolidated into Detailed mode)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 00:23:50 +05:30