-
-
Notifications
You must be signed in to change notification settings - Fork 295
Description
Expected Behavior
When used as a refiner in Refine / Upscale with 'Refiner Control percentage' > 0 and 'Refiner Do Tiling' checked, Qwen should work and refine the image.
Actual Behavior
Swarm throws an exception
ComfyUI execution error: too many values to unpack (expected 4)
Basically, it looks like split_latent_tensor and stitch_latent_tensors are expecting the passed-in latents to have 4 dimensions, but they have 5.
From a printf, we see the latent tensor passed into split has this shape
Hidream: torch.Size([1, 16, 278, 216])
Qwen image: torch.Size([1, 16, 1, 278, 216])
I guess the extra dimension is Frame, since this is inherited from a video model?
Full stack trace is in the debug logs section.
Steps to Reproduce
Use an init image.
Following parameters:
Init Image Creativity: 0,
Refiner Control Percentage: 0.2,
Refiner Method: Post-Apply (Normal),
Refiner Upscale: 2,
Refiner Upscale Method: Model: 4xNomos8kDAT.pth,
Refiner Do Tiling: true
Model: qwen-image-Q3_K_M.gguf
LoRAs: Qwen-Image-Lightning-8steps-V1.1-bf16 : 1
We get an error on the tiling step.
Debug Logs
10:37:30.390 [Warning] [ComfyUI-0/STDERR] Traceback (most recent call last):
10:37:30.391 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 496, in execute
10:37:30.391 [Warning] [ComfyUI-0/STDERR] output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
10:37:30.392 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:37:30.393 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 315, in get_output_data
10:37:30.394 [Warning] [ComfyUI-0/STDERR] return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
10:37:30.394 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:37:30.395 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 289, in _async_map_node_over_list
10:37:30.396 [Warning] [ComfyUI-0/STDERR] await process_inputs(input_dict, i)
10:37:30.396 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\dlbackend\comfy\ComfyUI\execution.py", line 277, in process_inputs
10:37:30.397 [Warning] [ComfyUI-0/STDERR] result = f(**inputs)
10:37:30.398 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^
10:37:30.399 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\src\BuiltinExtensions\ComfyUIBackend\ExtraNodes\SwarmComfyCommon\SwarmKSampler.py", line 324, in run_sampling
10:37:30.399 [Warning] [ComfyUI-0/STDERR] return self.tiled_sample(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, var_seed, var_seed_strength, sigma_max, sigma_min, rho, add_noise, return_with_leftover_noise, previews, tile_size)
10:37:30.400 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:37:30.401 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\src\BuiltinExtensions\ComfyUIBackend\ExtraNodes\SwarmComfyCommon\SwarmKSampler.py", line 311, in tiled_sample
10:37:30.401 [Warning] [ComfyUI-0/STDERR] tiles = split_latent_tensor(latent_samples, tile_size=tile_size)
10:37:30.402 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10:37:30.403 [Warning] [ComfyUI-0/STDERR] File "C:\Users\willh\SwarmUI\src\BuiltinExtensions\ComfyUIBackend\ExtraNodes\SwarmComfyCommon\SwarmKSampler.py", line 134, in split_latent_tensor
10:37:30.403 [Warning] [ComfyUI-0/STDERR] _, _, height, width = latent_tensor.shape
10:37:30.404 [Warning] [ComfyUI-0/STDERR] ^^^^^^^^^^^^^^^^^^^
10:37:30.405 [Warning] [ComfyUI-0/STDERR] ValueError: too many values to unpack (expected 4)
10:37:30.405 [Warning] [ComfyUI-0/STDERR]
Other
I have a PR for this that seems to work, filing a bug for context/tracking.