From 22ecccfbb8fc71fe2fd26defe463189357fe2eb5 Mon Sep 17 00:00:00 2001 From: JasonHoku Date: Fri, 6 Feb 2026 15:47:57 -0800 Subject: [PATCH] Fix Qwen Decode --- image_generation.py | 23 +++++++++++------------ pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/image_generation.py b/image_generation.py index 5b990a4..315d86a 100644 --- a/image_generation.py +++ b/image_generation.py @@ -78,10 +78,18 @@ def decode_latent_with_vae(vae, latent_samples): # Convert to PIL Image img_np = decoded.cpu().numpy() - img_np = np.clip(img_np[0] * 255, 0, 255).astype(np.uint8) + + # Remove extra dimensions (handle shapes like (1, 1, H, W, C) or (1, H, W, C)) + while img_np.ndim > 3: + img_np = img_np[0] + + # Now should be (H, W, C) or (C, H, W) + img_np = np.clip(img_np * 255, 0, 255).astype(np.uint8) # Handle different channel orders - if img_np.shape[0] == 3: # CHW format + if img_np.shape[0] == 3 and img_np.ndim == 3: # CHW format + img_np = np.transpose(img_np, (1, 2, 0)) + elif img_np.shape[-1] != 3 and img_np.ndim == 3: # Not HWC format img_np = np.transpose(img_np, (1, 2, 0)) return Image.fromarray(img_np) @@ -293,24 +301,15 @@ def flush_batch_with_vae(pending_batch, vae, img_dir, existing_data, session_nam # Get meta, use empty dict if not present manifest_meta = existing_data.get("meta", {}) - # Debug: print what we're sending - print(f"[GridTester] 📡 Sending dashboard update for node: {unique_id}") - PromptServer.instance.send_sync("ultimate_grid.update", { "node": unique_id, "session_name": session_name, "new_items": [meta], "meta": manifest_meta }) - print(f"[GridTester] ✅ Dashboard update sent successfully") - except (ImportError, KeyError) as e: + except (ImportError, KeyError): # Silently ignore dashboard update errors - print(f"[GridTester] ⚠️ Dashboard update error (silently ignored): {e}") pass - except Exception as e: - print(f"[GridTester] ⚠️ Unexpected dashboard error: {e}") - import traceback - traceback.print_exc() saved_count += 1 diff --git a/pyproject.toml b/pyproject.toml index acc7d4d..2ee6dbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ultimate-auto-sampler-config-grid-testing-suite" description = "ComfyUI Sampler testing & benchmarking tool for testing Stable Diffusion samplers, schedulers, CFG scales, prompts, img2img denoise values, and LoRA combinations. Features infinite-canvas dashboard image grids with virtual scrolling that can handle thousands of images, multi-model comparison, automatic resume on interrupt, and real-time visualization. Test entire checkpoint folders, stack multiple LoRAs, generate random seed variations, and export optimized configs. Includes fullscreen mode, keyboard navigation, smart filtering by parameters, and one-click regeneration workflow. Perfect for sampler output optimization and hyperparameter tuning." -version = "1.1.3" +version = "1.1.4" license = {file = "LICENSE"} classifiers = [ # # For OS-independent nodes (works on all operating systems)