Commit Graph
102 Commits
Author SHA1 Message Date
slahiriandClaude Opus 4.5 4e784a4f4e Auto-correct local provider URLs missing /v1 suffix
For LM Studio, Ollama, and custom OpenAI-compatible endpoints,
automatically append /v1 to the URL if missing. This prevents
the common "Unexpected endpoint or method" error when users
enter URLs like "http://127.0.0.1:1234" instead of the required
"http://127.0.0.1:1234/v1".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 14:22:57 +05:30
slahiriandClaude Opus 4.5 ddd9dd7d4d Organize model dropdown with folder-like grouping
Models with "/" in their name (e.g., meta-llama/Llama-Vision-Free) are
now grouped by prefix, making the dropdown easier to navigate. Models
without "/" appear first, followed by grouped models sorted by prefix.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 14:19:41 +05:30
slahiriandClaude Opus 4.5 79e23da929 Fix LM Studio empty response crash
Added validation for OpenAI-style API responses in _call_llm and
_analyze_component methods. LM Studio sometimes returns empty/null
choices array which caused 'NoneType is not subscriptable' crash.

Now provides clear error messages:
- "LLM returned None response - check if model is loaded"
- "LLM returned invalid response format"
- "LLM returned empty choices array"
- "LLM returned empty message content - model may have failed to generate"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 14:12:15 +05:30
slahiriandClaude Opus 4.5 416340c714 Permanently disable reasoning for local models
Local vision models (QwenVL, Phi-3.5, etc.) output chain-of-thought
mixed with results when reasoning is enabled, breaking JSON parsing
for agentic mode. Single-shot prompts work much better.

Changes:
- Removed enable_reasoning toggle from SID_LLM_Local UI
- Hardcoded reasoning_enabled = False
- Local models now always use single-shot pipeline

Cloud APIs (Anthropic, OpenAI, Gemini) still support reasoning mode.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:54:49 +05:30
slahiriandClaude Opus 4.5 7097781aa5 Add local test scripts to gitignore
- test_*.py
- compare_results.py
- download_test_images.py
- nul (Windows artifact)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:48:00 +05:30
slahiriandClaude Opus 4.5 bc17135b39 Enhance framing analysis with body visibility and rule of thirds
- Updated framing component (components.toml) with comprehensive analysis:
  - Body visibility tracking (head to feet, top to bottom)
  - Frame cutoff detection (where body is cropped)
  - Subject distance/scale (fills frame / medium / far)
  - Rule of thirds positioning (horizontal + vertical)
  - Enhanced JSON output schema for agentic mode

- Updated single-shot prompts (prompts.toml) for all tiers:
  - Advanced tier: detailed/extreme with FRAMING & VISIBILITY section
  - Standard tier: framing info in detailed/extreme modes
  - Basic tier: updated detailed/extreme with body visibility and positioning

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:31:54 +05:30
slahiriandClaude Opus 4.5 23e603541a Add body positioning and light/shadow to single-shot prompts
Updated Detailed and Extreme mode prompts (all tiers) to include:

Body Positioning (each limb independently):
- Left/right shoulder position and angle
- Left/right arm position, bend, hand placement
- Left/right leg position if visible
- Weight distribution

Light & Shadow Analysis:
- Face: highlight areas (forehead, cheekbones), shadow areas (under eyes, jawline)
- Chest/torso: where light and shadow fall
- Arms: light and shadow placement
- Overall direction, key/fill ratio, rim lighting, shadow color temp

This ensures single-shot mode captures the same detail as agentic mode
with the new body_positioning and light_shadow_body components.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:24:55 +05:30
slahiriandClaude Opus 4.5 0915918e81 Fix KSampler slowdown by removing global CUDA optimizations
Root cause: Global CUDA settings were interfering with ComfyUI's diffusion:

1. cudnn.benchmark=True causes re-benchmarking when input sizes change
   between local model inference and KSampler, adding significant overhead

2. TF32 settings may affect precision of subsequent operations

These optimizations were designed for single-use scenarios, not shared
environments like ComfyUI where multiple nodes use different operations.

Solution: Remove all global CUDA modifications. ComfyUI manages its own
CUDA state optimally. Our cleanup method still ensures proper state
restoration after inference.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:22:02 +05:30
slahiriandClaude Opus 4.5 4955931316 Add body positioning and light/shadow analysis components
New components for detailed prompt detection:

1. body_positioning - Detailed limb analysis:
   - Left/right shoulder position, angle, visibility
   - Left/right arm position, bend angle, hand placement
   - Left/right leg position, bend, weight distribution
   - All limbs analyzed independently

2. light_shadow_body - Light and shadow on body parts:
   - Face: highlights (forehead, cheekbones), shadows (under eyes, jawline)
   - Chest/torso: highlight and shadow areas
   - Arms/hands: light and shadow placement
   - Overall: main direction, key/fill ratio, rim lighting, shadow color temp

Added to "detailed" and "extreme" analysis modes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:05:23 +05:30
slahiriandClaude Opus 4.5 e5d648469b Fix VAE hang: remove global torch.set_grad_enabled(False)
Root cause: setup_cuda_optimizations() was calling torch.set_grad_enabled(False)
globally at module load, which disabled gradient computation for ALL nodes in
ComfyUI, breaking VAE decode and other nodes that need gradients.

Changes:
- Remove the global torch.set_grad_enabled(False) call
- Enhanced _cleanup_after_generation() to:
  - Restore gradient computation with torch.set_grad_enabled(True)
  - Force garbage collection after CUDA cleanup
  - Ensure clean GPU state for subsequent nodes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 13:01:09 +05:30
slahiriandClaude Opus 4.5 1f1e273119 Fix VAE decode hang by adding GPU cleanup after local model generation
Add _cleanup_after_generation() method that:
- Calls torch.cuda.synchronize() to ensure all CUDA operations complete
- Calls torch.cuda.empty_cache() to free GPU memory

This prevents ComfyUI's subsequent nodes (like VAE decode) from getting
stuck due to pending CUDA operations or fragmented GPU memory.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 12:54:47 +05:30
slahiriandClaude Opus 4.5 737b8dddc5 Add prompt_length dropdown and Z-Image prompting best practices
- Add prompt_length dropdown (Short/Medium/Long/Free) to control output length
- Default to "Free" (no constraint) for maximum flexibility
- Updated prompts.toml with Z-Image best practices:
  - Structured format: composition → subject → clothing → lighting
  - Geometric face angles (front view, 45°, profile)
  - Specific lighting keywords (soft diffused daylight, rim lighting)
  - Cleanup constraints at end (no text, no watermark)
- Added get_length_constraint() to config_loader.py
- Length constraints applied to both single-shot and agentic pipelines

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 09:20:30 +05:30
slahiriandClaude Opus 4.5 c5c316dd9e Fix Moondream2 quantization and Florence-2 beam search errors
- Moondream2: Disable bitsandbytes quantization (vision encoder has dtype
  mismatch with Half/Float in layer_norm). Always use BF16/FP16 instead.
- Florence-2: Use num_beams=1 for greedy decoding (beam search has cache
  compatibility issues with newer transformers causing NoneType errors)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:56:54 +05:30
slahiriandClaude Opus 4.5 c93f043a00 Add Phi-3.5 Vision speed note to README
- Phi-3.5 Vision marked as fastest local model
- Updated recommendation to note QwenVL for quality, Phi for speed

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:52:04 +05:30
slahiriandClaude Opus 4.5 6f74249807 Add QwenVL recommendation to README
QwenVL currently produces the best quality prompts among local models.
Updated table and added recommendation note.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:44:13 +05:30
slahiriandClaude Opus 4.5 1472f08b56 Fix local model errors: Florence-2 dtype, Moondream2 cache, DynamicCache
- Florence-2: Cast input tensors to model dtype (fixes BFloat16 mismatch)
- Moondream2: Use HF repo with force_download on cache corruption retry
- DynamicCache: Clear sys.modules cache to prevent stale imports
- Cache clearing: Also remove transformers_modules Python module entries

Fixes:
- RuntimeError: Input type (float) and bias type (struct c10::BFloat16)
- FileNotFoundError: .../transformers_modules/Moondream2/layers.py

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:42:03 +05:30
slahiriandClaude Opus 4.5 731e6a3b84 Fix DynamicCache compatibility for transformers 4.49+
The compatibility shim now handles both old and new transformers versions:
- Try get_seq_length() method first (newer transformers)
- Fall back to key_cache attribute access (older transformers)
- Return 0 if neither method is available

This fixes AttributeError: 'DynamicCache' object has no attribute 'key_cache'
when using Phi-3.5-Vision with newer transformers versions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:38:20 +05:30
slahiriandClaude Opus 4.5 555237e3a3 Update README with local model performance note
Add documentation that local models perform better with reasoning disabled
(single-shot mode) since they struggle with structured JSON output required
for agentic analysis.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:35:17 +05:30
slahiriandClaude Opus 4.5 e09a292b3d Disable reasoning by default for local models
Local Thinking models work better with single-shot mode rather than
agentic/reasoning mode which requires JSON output parsing. API providers
keep reasoning enabled by default as they handle structured output better.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:22:49 +05:30
slahiriandClaude Opus 4.5 90ea36baed Add fallback for agentic mode when JSON parsing fails + include component_results in metadata
- Add raw text fallback in _call_reasoning_llm when JSON parsing fails
- Add _clean_thinking_text method to extract useful content from thinking models
- Handle _raw_fallback_text in _execute_agentic to prevent empty prompts
- Include component_results in metadata JSON to show LLM response data

This fixes the empty prompt issue for local Thinking models (like Qwen3-VL-4B-Thinking)
in agentic/reasoning mode where the model outputs reasoning text instead of JSON.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:13:14 +05:30
slahiriandClaude Opus 4.5 60fe80f53c Fix _clean_thinking_output returning empty for thinking models
- Better handling of <think>...</think> tag extraction
- If nothing after </think>, extract from inside the tags
- Always return something (cleaned text or original) rather than empty
- Added more JSON extraction patterns for agentic mode output

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:21:06 +05:30
slahiriandClaude Opus 4.5 c6b35a6c53 Filter chain-of-thought reasoning from Thinking models output
- Add _clean_thinking_output() method to remove reasoning from output
- Handle <think>...</think> tags from QwenVL Thinking models
- Detect and skip plain-text reasoning patterns (Let me, We are given, etc.)
- Extract actual answer from JSON blocks or after common delimiters
- Fall back to last substantial paragraph when reasoning pattern detected

Fixes issue where Qwen3-VL Thinking models would output their entire
reasoning chain instead of just the final prompt.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:10:18 +05:30
slahiriandClaude Opus 4.5 34fdf238ee Fix user guidance enhancement for local vision models
- Remove [MODIFICATION: ...] fallback tag that was appearing in output
- Add string-based enhancement for local vision models since they can't
  do text-only LLM calls reliably
- Add _apply_string_enhancement() to intelligently parse and apply user
  instructions like "convert the dress into yellow colour"
- Handle common patterns: "make X", "change to X", "convert X into Y"
- Fall back to calling enhancement on agentic pipeline when user_focus
  not extracted from JSON

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:08:02 +05:30
slahiriandClaude Opus 4.5 01a636807f Add Qwen3-VL-8B-Thinking model
Best reasoning model in the Qwen3-VL lineup:
- 8B parameters with thinking/reasoning capability
- VRAM: 4.5GB (4-bit), 7GB (8-bit), 12GB (FP16)
- 4K max output tokens

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:57:26 +05:30
slahiriandClaude Opus 4.5 b948163af5 Fix Florence-2 SDPA and Moondream2 cache issues
- Florence-2: Force eager attention to avoid _supports_sdpa error
  (Florence-2's custom code doesn't define this attribute)
- Moondream2: Add cache corruption detection and auto-cleanup
  (clears transformers_modules cache and retries on FileNotFoundError)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:51:12 +05:30
slahiriandClaude Opus 4.5 bbbeed5a57 Add DynamicCache compat to all local models (except Qwen)
Apply DynamicCache compatibility patch to:
- Florence-2
- Moondream2
- SmolVLM
- Phi-3.5-Vision (already had it)

Qwen works fine without the patch.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:49:04 +05:30
slahiriandClaude Opus 4.5 bb5c564e92 Fix DynamicCache compatibility for transformers 4.49+
Add holistic _patch_dynamic_cache_compat() method that adds
compatibility shims for deprecated/removed DynamicCache methods:
- seen_tokens property
- get_max_length() method
- get_usable_length(new_seq_length, layer_idx) method

This fixes Phi-3.5-Vision inference on newer transformers versions.
See: https://github.com/huggingface/transformers/issues/36071

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:39:38 +05:30
slahiriandClaude Opus 4.5 9f213656e5 Fix get_usable_length to accept layer_idx parameter
The Phi-3.5-Vision model calls get_usable_length(kv_seq_len, layer_idx)
with two arguments, not just one.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:36:48 +05:30
slahiriandClaude Opus 4.5 8e1823406e Fix DynamicCache.get_usable_length compatibility for transformers
Add get_usable_length method to DynamicCache compatibility shim for
newer transformers versions that removed this method.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:32:29 +05:30
slahiriandClaude Opus 4.5 d5a7c5338c Add second LLM call for user instruction enhancement
- Add _enhance_prompt_with_instructions() method that makes a second
  LLM call to intelligently apply user modifications to generated prompts
- Fix DynamicCache compatibility for newer transformers versions
  (seen_tokens and get_max_length attributes)
- Fix output token extraction to only decode new tokens, preventing
  system prompt from appearing in output
- Improve user guidance handling with MODIFICATION directive in
  system prompts for better instruction following
- Only call enhancement LLM when user_guidance is provided

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:30:02 +05:30
slahiriandClaude Opus 4.5 2f269f05ba Add subject-aware analysis, metadata/debug outputs, and enhanced user guidance
- Add subject-type-aware component filtering for LANDSCAPE/VEHICLE/ANIMAL/PRODUCT
- Add new components: landscape_terrain, landscape_weather, landscape_scenery,
  vehicle_details, animal_details, product_details
- Update framing component to be subject-neutral (removed human-specific pose)
- Add SUBJECT_COMPONENTS mapping for appropriate analysis per subject type
- Add metadata and debug string outputs to prompt generator node
- Enhance user guidance to be contextually integrated with image analysis
  instead of simple [FOCUS:] prefix
- Remove redundant user guidance prepending in single-shot mode

Fixes landscape images incorrectly getting human-centric descriptions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:53:00 +05:30
slahiriandClaude Opus 4.5 e6cd13c29d Fix flash_attn detection to check package metadata
The flash_attn module could be imported but was missing package metadata,
causing transformers to fail when checking the version. Now we properly
check importlib.metadata.version() before enabling flash_attention_2,
falling back to SDPA if metadata is missing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:34:57 +05:30
slahiriandClaude Opus 4.5 657f2f598e Add body_figure component with cup size, nudity level, and body proportions
- Add comprehensive body_figure component to analyze:
  - Nudity/exposure level (clothed to nude)
  - Breast exposure details (covered/cleavage/sideboob/underboob)
  - Cup size estimation (AA/A through G+)
  - Body type, bust shape, cleavage visibility and shadows
  - Waist definition, hip curves, buttocks shape
  - Thigh fullness and body contour shadows
- Update DETAIL_MODES to include body_figure in Standard/Detailed/Extreme
- Update component order array for prompt assembly

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:21:40 +05:30
slahiriandClaude Opus 4.5 c4c579a7ca Reddit feedback fixes: sample workflows, prompts, vision warnings
- Add sample workflows for Ollama, Groq, OpenRouter, and local QwenVL
- Add vision model warning for Ollama/LM Studio non-vision models (warn but allow)
- Improve basic tier prompts with examples for local models
- Remove numbered lists in favor of flowing instructions
- Add more cleanup patterns for local model output prefixes
- Fix issues #4 (sample workflows) and #5 (local model prompts)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:52:54 +05:30
slahiriandClaude Opus 4.5 92c178488a Fix Reddit-reported issues: GPU detection, Ollama models, params
Fixes #4, #5 (partial):
- Add detailed GPU detection logging (device name, compute capability, VRAM)
- Add bitsandbytes installation check with warning
- Add dynamic Ollama model detection via /api/tags endpoint
- Add dynamic LM Studio model detection via /v1/models endpoint
- Pass missing params (repetition_penalty, top_p, use_torch_compile) to LocalModelClient
- Add gemma3:latest to Ollama fallback list

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:43:59 +05:30
slahiriandClaude Opus 4.5 b01c117175 Enhance local model support with advanced QwenVL options
- Add attention_mode selection (auto/flash_attention_2/sdpa/eager)
- Add torch.compile support for CUDA acceleration (~20-30% speedup)
- Add repetition_penalty and top_p parameters for better output control
- Implement response validation with retry logic for short responses
- Add adaptive resolution based on Qwen model version (Qwen3 vs Qwen2.5)
- Add quality metrics tracking (word count, tokens/sec)
- Add provider-specific cleanup patterns (Groq, Together, Fireworks, etc.)
- Update providers.toml with local model configurations and VRAM guidelines

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:34:33 +05:30
slahiriandClaude Opus 4.5 a10e69a940 Add TOML-based config for tier-specific prompts
Implements externalized configuration using TOML files for:
- Provider tiers (advanced/standard/basic) and stop strings
- Tier-specific system/user prompts for local vs cloud models
- Component prompts for agentic analysis by tier
- Output filter patterns for example text removal

Local models (Ollama, LM Studio) now get simplified prompts
without JSON output or complex numbered instructions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:18:42 +05:30
slahiriandClaude Opus 4.5 9d134da3e8 v4.2.0: Consolidate to 3 unified nodes
Major refactor consolidating 8+ nodes into 3 unified nodes:

NEW NODES:
- SID_LLM_API: Unified cloud provider (15+ APIs including Anthropic, OpenAI, Gemini, Grok, Ollama, LM Studio)
- SID_LLM_Local: Unified local models (Florence-2, Moondream2, SmolVLM, Phi-3.5, QwenVL)
- SID_ZImagePromptGenerator: Unified prompt generator with auto Single-Shot/Agentic pipeline selection

DEPRECATED (removed):
- SID_Anthropic_LLM → use SID_LLM_API
- SID_OpenAI_Compatible_LLM → use SID_LLM_API
- SID_Grok_LLM → use SID_LLM_API
- SID_GGUF_LLM → use SID_LLM_Local
- SID_QwenVL_LLM → use SID_LLM_Local
- SID_ZImagePromptGenerator_Advanced_V2 → use SID_ZImagePromptGenerator

SPEED OPTIMIZATIONS (SID_LLM_Local):
- CUDA optimizations (cudnn.benchmark, TF32)
- BF16 auto-selection for Ampere+ GPUs
- Flash Attention 2 / SDPA auto-selection
- KV cache enabled for all models
- Memory cleanup on model switch

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 03:43:05 +05:30
slahiriandClaude Opus 4.5 af467b27cf Remove GGUF LLM provider node
- Delete SID_GGUF_LLM node and related files
- Remove llm_providers/sid_gguf_llm.py
- Remove prompt_templates/local_gguf_template.py
- Remove sample_workflows/sample_workflow_gguf.json
- Remove GGUF provider from generator nodes
- Simplify template_factory.py to use Claude template for all providers
- Update pyproject.toml keywords
- QwenVL is now the recommended local LLM provider

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 02:10:16 +05:30
slahiriandClaude Opus 4.5 3b30e62966 Add image tensor caching to QwenVLClient for faster component mode
- Added class-level image cache (hash -> processed tensors)
- Cache pixel_values and image_grid_thw between calls with same image
- LRU-style cache with max 3 images (for component mode)
- Significantly speeds up component mode (8+ calls per image)
- Already had model caching and KV cache enabled

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 01:45:35 +05:30
slahiriandClaude Opus 4.5 71d62d999c Enable Anthropic prompt caching by default for cost/latency reduction
- Updated all Anthropic API calls to use cache_control with ephemeral type
- Cache reads are 0.1x the cost of input tokens (90% savings)
- Latency reduction up to 85% on cached prompts
- Cache lasts 5 minutes, refreshed on each use
- Applied to: Basic generator, Advanced V2 generator, iterative_improve.py

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 01:40:41 +05:30
slahiriandClaude Opus 4.5 1589783e49 Move reasoning toggle from generator to LLM provider nodes
- Added enable_reasoning toggle to SID_QwenVL_LLM, SID_Grok_LLM, SID_GGUF_LLM
- Removed prompt_mode dropdown from Advanced V2 generator
- Generator now auto-detects reasoning from llm_model.supports_reasoning
- Reasoning only enables when BOTH model supports it AND user enables it
- Anthropic and OpenAI Compatible nodes already had use_reasoning toggle

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 01:34:19 +05:30
slahiriandClaude Opus 4.5 7763fa426b Fix flash_attn detection to check package metadata
The transformers library checks flash_attn version via importlib.metadata,
which fails on Windows even if the import succeeds. Now we check both
the import AND the package metadata before using flash_attention_2,
falling back to sdpa if either fails.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 01:25:04 +05:30
slahiriandClaude Opus 4.5 23440ca2e9 Change QwenVL max_tokens to slider (512-4096)
- Convert max_tokens input to slider display mode
- Range: 512 to 4096 tokens
- Step: 128 for nice increments

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 01:23:27 +05:30
slahiriandClaude Opus 4.5 ecb518d53e Fix Anthropic timeout error for long vision requests
Add 600s timeout to Anthropic client in both Basic and Advanced V2
generators to prevent "Streaming is strongly recommended for operations
that may take longer than 10 minutes" error.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 01:08:38 +05:30
slahiriandClaude Opus 4.5 43c28e162a refactor: Simplify QwenVL to Instruct + Thinking models only
Remove FP8 and Qwen2.5-VL models, keep only Qwen3-VL:
- Instruct: 2B, 4B, 8B, 32B (standard instruction-following)
- Thinking: 2B, 4B, 8B (reasoning models for Agentic mode)

Total 7 models (was 12):
| Model | 4-bit | 8-bit | FP16 |
|-------|-------|-------|------|
| 2B    | 1.5GB | 2.5GB | 4GB  |
| 4B    | 2GB   | 3.5GB | 6GB  |
| 8B    | 4.5GB | 7GB   | 12GB |
| 32B   | 8.5GB | 14GB  | 28GB |

Thinking models enable Agentic mode in Advanced V2 generator.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 00:52:06 +05:30
slahiriandClaude Opus 4.5 6cc20a5756 refactor: Simplify Standard Generator with preset styles
Complete rewrite of SID_ZImagePromptGenerator for user-friendliness:
- Uses LLM_MODEL input from provider nodes (consistent with V2)
- Preset styles with emojis:
  - Detailed Description (comprehensive)
  - Portrait Focus (face/expression)
  - Fashion & Outfit (clothing)
  - Artistic Style (composition/lighting)
  - Quick Caption (brief, fast)
  - NSFW/Detailed (body details)
- Optional custom_guidance field for specific instructions
- Single-shot generation (fast, single LLM call)
- Simplified inputs: just image, llm_model, preset, guidance, seed
- Removed complex multi-stage pipeline and all toggles

Now mirrors QwenVL's simple UI approach while using our LLM provider architecture.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 00:42:50 +05:30
slahiriandClaude Opus 4.5 70457c5828 feat: Enhance SID_QwenVL_LLM with advanced options from QwenVL node
- Add 12 model variants: Instruct, Thinking, FP8, and 32B models
- Add VRAM auto-downgrade with 20% safety margin
- Add attention_mode selection (auto, flash_attention_2, sdpa, eager)
- Add generation parameters: top_p, repetition_penalty, num_beams
- Thinking models now report supports_reasoning=True for agentic mode
- Pre-quantized FP8 models for fast loading
- Update generator _get_client() to pass new QwenVL parameters
- Bump version to 4.2.0

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 00:38:28 +05:30
slahiriandClaude Opus 4.5 ee5005ccd0 feat: Add Single Shot vs Agentic prompt mode toggle
Major improvements to prompt generation:

1. NEW: prompt_mode toggle with two options:
   - "Single Shot" (default): Fast single-call approach using comprehensive prompts
   - "Agentic (Reasoning Models)": Deep analysis for models with reasoning capability

2. Single Shot Pipeline:
   - One LLM call instead of multiple iterative calls
   - Uses our component knowledge condensed into well-structured prompts
   - Detail mode affects prompt depth (Standard/Detailed/Extreme)
   - Auto-cleans output to remove markdown/formatting
   - Much faster than iterative approach

3. Agentic Mode Validation:
   - Automatically falls back to Single Shot if model doesn't support reasoning
   - Clear warning when mismatch detected
   - Requires reasoning-capable models (Claude 3.5, o1, etc.)

4. [DEPRECATED] Iterative pipeline:
   - Multi-step looping approach marked as deprecated
   - Kept for backward compatibility but no longer used by default

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 00:28:59 +05:30
slahiriandClaude Opus 4.5 10244097e0 feat: Add SID_QwenVL_LLM - local vision model using HuggingFace transformers
Adds new QwenVL provider as alternative to GGUF:
- Uses HuggingFace transformers with BitsAndBytes quantization
- No llama-cpp-python required (easier cross-platform installation)
- Supports Qwen3-VL (2B/4B/8B) and Qwen2.5-VL (3B/7B) models
- Auto-downloads models from HuggingFace on first use
- Model caching option to keep loaded between runs

Changes:
- New llm_providers/sid_qwenvl_llm.py with QwenVLClient class
- Mark SID_GGUF_LLM as deprecated in favor of QwenVL
- Add qwenvl provider routing in generator _get_client
- Update template_factory.py for qwenvl provider
- Add transformers and accelerate to dependencies
- bitsandbytes as optional dependency for quantization

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 00:22:18 +05:30