Giter Site home page Giter Site logo

comfyui_tiledksampler's People

Contributors

blenderneko avatar ltdrdata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

comfyui_tiledksampler's Issues

How do I use the TiledKSampler ?

I'm trying to generate one big image but I get multiple unrelated images of 512x512 inside one big image. Is it possible to render a 1920x1080 image by splitting it in 512x512 tiles ? I only have 8GB of video ram.

Entire extension broken by ComfyUI sample.py refactor from 3 days ago

Relevant commit: comfyanonymous/ComfyUI@0542088

The linked commit above from 3 days ago that refactored sample.py has broken this extension.

Traceback (most recent call last):
File "C:\comfy\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\comfy\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\comfy\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\comfy\custom_nodes\ComfyUI_TiledKSampler-master\nodes.py", line 320, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)

File "C:\comfy\custom_nodes\ComfyUI_TiledKSampler-master\nodes.py", line 124, in sample_common
positive_copy = comfy.sample.convert_cond(positive)
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'comfy.sample' has no attribute 'convert_cond'

comfy.sample has no attribute 'broadcast_cond'

given what I've read in some of your closed issues, it looks like comfyui may have changed something in the backend on their newest version? Using your tiled ksampler directly, or through efficiency nodes or impact pack, all throw this error

Error occurred when executing BNK_TiledKSampler:

module 'comfy.sample' has no attribute 'broadcast_cond'

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 315, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 180, in sample_common
positive_copy = comfy.sample.broadcast_cond(positive, shape[0], device)

Failure with dpmpp_3m_sde/dpmpp_3m_sde_gpu

This error appears when the progress bar of TiledKSampler reaches ~95%:

Error occurred when executing BNK_TiledKSampler:

local variable 'h' referenced before assignment

  File "D:\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 305, in sample
    return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
  File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 261, in sample_common
    tile_result = sampler.sample(tiled_noise, pos, neg, cfg=cfg, latent_image=tiled_latent, start_step=start_at_step + i * tile_steps, last_step=start_at_step + i*tile_steps + tile_steps, force_full_denoise=force_full_denoise and i+1 == end_at_step - start_at_step, denoise_mask=tiled_mask, callback=callback, disable_pbar=True, seed=noise_seed)
  File "D:\ComfyUI\comfy\samplers.py", line 733, in sample
    samples = getattr(k_diffusion_sampling, "sample_{}".format(self.sampler))(self.model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar)
  File "D:\ComfyUI\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\ComfyUI\comfy\k_diffusion\sampling.py", line 695, in sample_dpmpp_3m_sde_gpu
    return sample_dpmpp_3m_sde(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, eta=eta, s_noise=s_noise, noise_sampler=noise_sampler)
  File "D:\ComfyUI\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\ComfyUI\comfy\k_diffusion\sampling.py", line 688, in sample_dpmpp_3m_sde
    h_1, h_2 = h, h_1

Dtype missing error?

Now, I know this is likely an issue on my end, but at least one other person I know has the same issue.

ive had an issue like this when impossible resolutions got sent to a sampler...

Its kind of getting in the way of my work lol.

Error occurred when executing BNK_TiledKSampler:

load_additional_models() missing 1 required positional argument: 'dtype'

File "D:\othercomfy\origin\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\othercomfy\origin\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\othercomfy\origin\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\othercomfy\origin\ComfyUI\custom_nodes\ComfyUI_TiledKSampler-master\nodes.py", line 278, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0)
File "D:\othercomfy\origin\ComfyUI\custom_nodes\ComfyUI_TiledKSampler-master\nodes.py", line 115, in sample_common
models = comfy.sample.load_additional_models(positive, negative)

something wrong with processing mask conditioning

Traceback (most recent call last):
File "D:\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 357, in sample
return sample_common(model, add_noise, noise_seed, tile_width, tile_height, tiling_strategy, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0, preview= preview == 'enable')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 173, in sample_common
spatial_conds_pos = [
^
File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 175, in
comfy.sample.prepare_mask(c[1]['mask'], shape, device) if 'mask' in c[1] else None)

“comfyUI” startup error

ImportError: huggingface-hub>=0.23.0,<1.0 is required for a normal functioning of this module, but found huggingface-hub==0.20.3.
Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main

Fails when using a model patched with Tome

With different TOME patch ratios, tile sizes, and image sizes the error can occur instantly in the TiledKSampler or after some number of steps.

Here is an example workflow that I get the issue with.

JSON
{ "last_node_id": 11, "last_link_id": 16, "nodes": [ { "id": 7, "type": "CLIPTextEncode", "pos": [ 413, 389 ], "size": { "0": 425.27801513671875, "1": 180.6060791015625 }, "flags": {}, "order": 4, "mode": 0, "inputs": [ { "name": "clip", "type": "CLIP", "link": 5 } ], "outputs": [ { "name": "CONDITIONING", "type": "CONDITIONING", "links": [ 12 ], "slot_index": 0 } ], "properties": { "Node name for S&R": "CLIPTextEncode" }, "widgets_values": [ "text, watermark" ] }, { "id": 6, "type": "CLIPTextEncode", "pos": [ 415, 186 ], "size": { "0": 422.84503173828125, "1": 164.31304931640625 }, "flags": {}, "order": 3, "mode": 0, "inputs": [ { "name": "clip", "type": "CLIP", "link": 3 } ], "outputs": [ { "name": "CONDITIONING", "type": "CONDITIONING", "links": [ 11 ], "slot_index": 0 } ], "properties": { "Node name for S&R": "CLIPTextEncode" }, "widgets_values": [ "beautiful scenery nature glass bottle landscape, , purple galaxy bottle," ] }, { "id": 8, "type": "VAEDecode", "pos": [ 1209, 188 ], "size": { "0": 210, "1": 46 }, "flags": {}, "order": 6, "mode": 0, "inputs": [ { "name": "samples", "type": "LATENT", "link": 14 }, { "name": "vae", "type": "VAE", "link": 8 } ], "outputs": [ { "name": "IMAGE", "type": "IMAGE", "links": [ 9 ], "slot_index": 0 } ], "properties": { "Node name for S&R": "VAEDecode" } }, { "id": 9, "type": "SaveImage", "pos": [ 1451, 189 ], "size": { "0": 210, "1": 270 }, "flags": {}, "order": 7, "mode": 0, "inputs": [ { "name": "images", "type": "IMAGE", "link": 9 } ], "properties": {}, "widgets_values": [ "ComfyUI" ] }, { "id": 4, "type": "CheckpointLoaderSimple", "pos": [ 26, 474 ], "size": { "0": 315, "1": 98 }, "flags": {}, "order": 0, "mode": 0, "outputs": [ { "name": "MODEL", "type": "MODEL", "links": [ 15 ], "slot_index": 0 }, { "name": "CLIP", "type": "CLIP", "links": [ 3, 5 ], "slot_index": 1 }, { "name": "VAE", "type": "VAE", "links": [ 8 ], "slot_index": 2 } ], "properties": { "Node name for S&R": "CheckpointLoaderSimple" }, "widgets_values": [ "sd15.ckpt" ] }, { "id": 5, "type": "EmptyLatentImage", "pos": [ 515, 616 ], "size": { "0": 315, "1": 106 }, "flags": {}, "order": 1, "mode": 0, "outputs": [ { "name": "LATENT", "type": "LATENT", "links": [ 13 ], "slot_index": 0 } ], "properties": { "Node name for S&R": "EmptyLatentImage" }, "widgets_values": [ 768, 640, 1 ] }, { "id": 11, "type": "TomePatchModel", "pos": [ 626, 89 ], "size": [ 210, 58 ], "flags": {}, "order": 2, "mode": 0, "inputs": [ { "name": "model", "type": "MODEL", "link": 15 } ], "outputs": [ { "name": "MODEL", "type": "MODEL", "links": [ 16 ], "slot_index": 0 } ], "properties": { "Node name for S&R": "TomePatchModel" }, "widgets_values": [ 0.3 ] }, { "id": 10, "type": "BNK_TiledKSamplerAdvanced", "pos": [ 873, 185 ], "size": { "0": 315, "1": 406 }, "flags": {}, "order": 5, "mode": 0, "inputs": [ { "name": "model", "type": "MODEL", "link": 16 }, { "name": "positive", "type": "CONDITIONING", "link": 11 }, { "name": "negative", "type": "CONDITIONING", "link": 12 }, { "name": "latent_image", "type": "LATENT", "link": 13 } ], "outputs": [ { "name": "LATENT", "type": "LATENT", "links": [ 14 ], "slot_index": 0 } ], "properties": { "Node name for S&R": "BNK_TiledKSamplerAdvanced" }, "widgets_values": [ "enable", 56302674661794, "randomize", 512, 512, 1, 11, 6.5, "dpmpp_2m", "karras", 0, 10, "disable" ] } ], "links": [ [ 3, 4, 1, 6, 0, "CLIP" ], [ 5, 4, 1, 7, 0, "CLIP" ], [ 8, 4, 2, 8, 1, "VAE" ], [ 9, 8, 0, 9, 0, "IMAGE" ], [ 11, 6, 0, 10, 1, "CONDITIONING" ], [ 12, 7, 0, 10, 2, "CONDITIONING" ], [ 13, 5, 0, 10, 3, "LATENT" ], [ 14, 10, 0, 8, 0, "LATENT" ], [ 15, 4, 0, 11, 0, "MODEL" ], [ 16, 11, 0, 10, 0, "MODEL" ] ], "groups": [], "config": {}, "extra": {}, "version": 0.4 }

Here's my traceback:

  File "D:\ComfyUI\execution.py", line 195, in execute
    recursive_execute(self.server, prompt, self.outputs, x, extra_data, executed)
  File "D:\ComfyUI\execution.py", line 58, in recursive_execute
    recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
  File "D:\ComfyUI\execution.py", line 58, in recursive_execute
    recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
  File "D:\ComfyUI\execution.py", line 67, in recursive_execute
    outputs[unique_id] = getattr(obj, obj.FUNCTION)(**input_data_all)
  File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 138, in sample
    tile_result = sampler.sample(noise_tile, pos, neg, cfg=cfg, latent_image=latent_tiles, start_step=start_at_step + i * steps_per_tile, last_step=start_at_step + i*steps_per_tile + steps_per_tile, force_full_denoise=force_full_denoise and i+1 == end_at_step - start_at_step, denoise_mask=masks, disable_pbar=True)
  File "D:\ComfyUI\comfy\samplers.py", line 669, in sample
    samples = getattr(k_diffusion_sampling, "sample_{}".format(self.sampler))(self.model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "D:\ComfyUI\comfy\k_diffusion\sampling.py", line 594, in sample_dpmpp_2m
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\ComfyUI\comfy\samplers.py", line 283, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, cond_concat=cond_concat, model_options=model_options)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\ComfyUI\comfy\k_diffusion\external.py", line 114, in forward
    eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
  File "D:\ComfyUI\comfy\k_diffusion\external.py", line 140, in get_eps
    return self.inner_model.apply_model(*args, **kwargs)
  File "D:\ComfyUI\comfy\samplers.py", line 271, in apply_model
    out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, cond_concat, model_options=model_options)
  File "D:\ComfyUI\comfy\samplers.py", line 250, in sampling_function
    cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, cond_concat, model_options)
  File "D:\ComfyUI\comfy\samplers.py", line 227, in calc_cond_uncond_batch
    output = model_function(input_x, timestep_, cond=c).chunk(batch_chunks)
  File "D:\ComfyUI\comfy\ldm\models\diffusion\ddpm.py", line 859, in apply_model
    x_recon = self.model(x_noisy, t, **cond)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\ComfyUI\comfy\ldm\models\diffusion\ddpm.py", line 1337, in forward
    out = self.diffusion_model(x, t, context=cc, control=control, transformer_options=transformer_options)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 821, in forward
    h = forward_timestep_embed(module, h, emb, context, transformer_options)
  File "D:\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 97, in forward_timestep_embed
    x = layer(x, context, transformer_options)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\accelerate\hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "D:\ComfyUI\comfy\ldm\modules\attention.py", line 634, in forward
    x = block(x, context=context[i], transformer_options=transformer_options)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\accelerate\hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "D:\ComfyUI\comfy\ldm\modules\attention.py", line 523, in forward
    return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
  File "D:\ComfyUI\comfy\ldm\modules\diffusionmodules\util.py", line 121, in checkpoint
    return CheckpointFunction.apply(func, len(inputs), *args)
  File "D:\ComfyUI\comfy\ldm\modules\diffusionmodules\util.py", line 136, in forward
    output_tensors = ctx.run_function(*ctx.input_tensors)
  File "D:\ComfyUI\comfy\ldm\modules\attention.py", line 550, in _forward
    m, u = tomesd.get_functions(x, transformer_options["tomesd"]["ratio"], transformer_options["original_shape"])
  File "D:\ComfyUI\comfy\ldm\modules\tomesd.py", line 140, in get_functions
    m, u = bipartite_soft_matching_random2d(x, w, h, stride_x, stride_y, r, no_rand)
  File "D:\ComfyUI\comfy\ldm\modules\tomesd.py", line 92, in bipartite_soft_matching_random2d
    node_max, node_idx = scores.max(dim=-1)
IndexError: max(): Expected reduction dim 2 to have non-zero size.

Error occurred when executing BNK_TiledKSamplerAdvanced

Hi! I was trying to test the tiled sampler but got the following error:

Error occurred when executing BNK_TiledKSamplerAdvanced:

load_additional_models() missing 1 required positional argument: 'dtype'

File "D:\Code\stable-diffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 145, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\Code\stable-diffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\Code\stable-diffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 68, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\Code\stable-diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 309, in sample
return sample_common(model, add_noise, noise_seed, tile_width, tile_height, tiling_strategy, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0)
File "D:\Code\stable-diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 116, in sample_common
models = comfy.sample.load_additional_models(positive, negative)

no attribute 'load_additional_models'

Error occurred when executing BNK_TiledKSamplerAdvanced:
module 'comfy.sample' has no attribute 'load_additional_models'

I got this error , after update comfyUI,

Tile wide control nets vs image wide control nets

Reading the roadmap I'm not sure what is the difference between Tile wide controlnets and Image wide controlnets.

From the source code it appears the control image is sliced using the slice_cnet function meaning that each tile get a cropped control image (which is what I expected). Not sure what other kind of behaviour would be made possible by another type of CN processing?

RuntimeError: start (0) + length (120) exceeds dimension size (64).

when using this workflow
blenderneko cloud_panorama-wyrded.zip

got prompt
making attention of type 'vanilla-pytorch' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla-pytorch' with 512 in_channels
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.64s/it]
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  3.30it/s]
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.42s/it]
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.19it/s]
  3%|██▎                                                                                | 1/35 [00:06<03:31,  6.22s/it]
Traceback (most recent call last):
  File "D:\sd\comfyui\comfy\execution.py", line 195, in execute
    recursive_execute(self.server, prompt, self.outputs, x, extra_data, executed)
  File "D:\sd\comfyui\comfy\execution.py", line 58, in recursive_execute
    recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
  File "D:\sd\comfyui\comfy\execution.py", line 58, in recursive_execute
    recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
  File "D:\sd\comfyui\comfy\execution.py", line 58, in recursive_execute
    recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
  [Previous line repeated 3 more times]
  File "D:\sd\comfyui\comfy\execution.py", line 67, in recursive_execute
    outputs[unique_id] = getattr(obj, obj.FUNCTION)(**input_data_all)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sd\comfyui\comfy\custom_nodes\TiledKSampler\nodes.py", line 96, in sample
    slices = [tiling.get_slice(samples, x1,x2,y1,y2) for x1,x2,y1,y2,_ in tiles_batch]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sd\comfyui\comfy\custom_nodes\TiledKSampler\nodes.py", line 96, in <listcomp>
    slices = [tiling.get_slice(samples, x1,x2,y1,y2) for x1,x2,y1,y2,_ in tiles_batch]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sd\comfyui\comfy\custom_nodes\TiledKSampler\tiling.py", line 21, in get_slice
    t = tensor.narrow(-2, h, h_len)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: start (0) + length (120) exceeds dimension size (64).

breaks when using non-square resolutions

tensor slices go out of bounds when using a non-square resolution, possibly mixing up width and height

Traceback (most recent call last): File "V:\ComfyUI-dev[execution.py](http://execution.py/)", line 195, in execute recursive_execute(self.server, prompt, self.outputs, x, extra_data, executed)
File "V:\ComfyUI-dev[execution.py](http://execution.py/)", line 58, in recursive_execute recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
File "V:\ComfyUI-dev[execution.py](http://execution.py/)", line 58, in recursive_execute recursive_execute(server, prompt, outputs, input_unique_id, extra_data, executed)
File "V:\ComfyUI-dev[execution.py](http://execution.py/)", line 67, in recursive_execute outputs[unique_id] = getattr(obj, obj.FUNCTION)(**input_data_all) File "V:\ComfyUI-dev\custom_nodes\ComfyUI_TiledKSampler[nodes.py](http://nodes.py/)", line 96, in sample slices = [tiling.get_slice(samples, x1,x2,y1,y2) for x1,x2,y1,y2,_ in tiles_batch] File "V:\ComfyUI-dev\custom_nodes\ComfyUI_TiledKSampler[nodes.py](http://nodes.py/)", line 96, in slices = [tiling.get_slice(samples, x1,x2,y1,y2) for x1,x2,y1,y2,_ in tiles_batch] File "V:\ComfyUI-dev\custom_nodes\ComfyUI_TiledKSampler[tiling.py](http://tiling.py/)", line 21, in get_slice t = tensor.narrow(-2, h, h_len) RuntimeError: start (240) + length (128) exceeds dimension size (256).

'ControlLora' object has no attribute 'control_model'

This happens when using controlnet on tiled ksampler advanced

Loading 1 new model
0%| | 0/105 [00:00<?, ?it/s]
ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "G:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 347, in sample
return sample_common(model, add_noise, noise_seed, tile_width, tile_height, tiling_strategy, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0, preview= preview == 'enable')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 251, in sample_common
slice_cnet(tile_h, tile_h_len, tile_w, tile_w_len, m, img)
File "G:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 86, in slice_cnet
model.cond_hint = tiling.get_slice(img, h8, h_len8, w8, w_len8).to(model.control_model.dtype).to(model.device)
^^^^^^^^^^^^^^^^^^^
AttributeError: 'ControlLora' object has no attribute 'control_model'

'ModelPatcher' object has no attribute 'memory_required'

Getting this error when using TiledK Sampler (Advanced):

Advanced:

'ModelPatcher' object has no attribute 'memory_required'

File "\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ezXY\autoCastPatch.py", line 296, in map_node_over_list
return _map_node_over_list(obj, input_data_all, func, allow_interrupt)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 347, in sample
return sample_common(model, add_noise, noise_seed, tile_width, tile_height, tiling_strategy, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0, preview= preview == 'enable')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 124, in sample_common
comfy.model_management.load_models_gpu([model] + modelPatches, model.memory_required(noise.shape) + inference_memory)

How to perfectly tiled?

image
Sending your example image and also my test wouldn't make perfect image, I wonder how to solve this

RuntimeError: Expected all tensors to be on the same device

Does anyone happen to know why I might be running into this error when it hits the Tiled KSampler node? Regular KSampler works fine in its place.

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument weight in method wrapper_CUDA__native_group_norm)

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 320, in sample
    return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 276, in sample_common
    tile_result = sampler.sample(tiled_noise, pos, neg, cfg=cfg, latent_image=tiled_latent, start_step=start_at_step + i * tile_steps, last_step=start_at_step + i*tile_steps + tile_steps, force_full_denoise=force_full_denoise and i+1 == end_at_step - start_at_step, denoise_mask=tiled_mask, callback=callback, disable_pbar=True, seed=noise_seed)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 716, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 622, in sample
    samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 561, in sample
    samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\sampling.py", line 154, in sample_euler_ancestral
    denoised = model(x, sigmas[i] * s_in, **extra_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 285, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 275, in forward
    return self.apply_model(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 272, in apply_model
    out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 252, in sampling_function
    cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond_, x, timestep, model_options)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 226, in calc_cond_uncond_batch
    output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 85, in apply_model
    model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 854, in forward
    h = forward_timestep_embed(module, h, emb, context, transformer_options, time_context=time_context, num_video_frames=num_video_frames, image_only_indicator=image_only_indicator)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 52, in forward_timestep_embed
    x = layer(x)
        ^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\motion_module_ad.py", line 386, in forward
    return self.temporal_transformer(input_tensor, encoder_hidden_states, attention_mask)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\motion_module_ad.py", line 527, in forward
    hidden_states = self.norm(hidden_states).to(hidden_states.dtype)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\motion_utils.py", line 81, in forward
    return F.group_norm(
           ^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\functional.py", line 2558, in group_norm
    return torch.group_norm(input, num_groups, weight, bias, eps, torch.backends.cudnn.enabled)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument weight in method wrapper_CUDA__native_group_norm)

Prompt executed in 67.93 seconds

Does not work with AnimateDiff

More of a feature request -- I tried running this workflow myself with the animatediff module activated. Are there any plans to add animatediff support to this node? It'd be super helpful to be able to upscale video with an advanced tiled ksampler. Happy to contribute as well.

does not work

Error occurred when executing BNK_TiledKSampler:

module 'comfy.sample' has no attribute 'get_additional_models'

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 311, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 116, in sample_common
modelPatches = comfy.sample.get_additional_models(positive, negative)

what is the problem? how to fix?

Feature request: A separate node which does the tiling of the latent before it goes into the Tiled KSampler node

Similar to how the Tiled IPAdapter does it. The Tiled IPAdapter allows for processing the tiles separately while still retaining the overall conditioning from the IPAdapter (though not perfectly). This in turn allows for processing of the latent on multiple GPUs via the NetDist nodes, speeding up the processing significantly.

Not sure if it applicable in the same way to controlnets though.

Here is an example for the Tiled IPAdapter upscale where it only renders the first tile of four of the upscaled image. This upscale is in a 2x2 tiling. The tile is selected via the latent index in this case:
image

Tile KSampler Usage

Hello, how is this node supposed to work? Is it with ControlNet Tile Model? Could you please provide an example?

Thank you so much and congratulations for the amazing work!

The example script produces a black image.

I just tried again and the output is a black image. I used the beach example.

Console output:

100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.66it/s]
100%|████████████████████████████████████████████████████████████████████████████████| 236/236 [01:37<00:00,  2.42it/s]
D:\Code\stable-diffusion\ComfyUI_windows_portable\ComfyUI\nodes.py:1140: RuntimeWarning: invalid value encountered in cast
  img = Image.fromarray(np.clip(i, 0, 255).astype(np.uint8))
Prompt executed in 112.21 seconds

ModuleNotFoundError: No module named 'comfy.controlnet'

Hi; tried installing just now via the Manager and receive this issue when loading comfyui back up:

Traceback (most recent call last):
File "C:\Users\X\Desktop\Comfy\ComfyUI\nodes.py", line 1665, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\X\Desktop\Comfy\ComfyUI\custom_nodes\ComfyUI_TiledKSampler_init
.py", line 1, in
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "C:\Users\X\Desktop\Comfy\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 12, in
import comfy.controlnet
ModuleNotFoundError: No module named 'comfy.controlnet'

Cannot import C:\Users\X\Desktop\Comfy\ComfyUI\custom_nodes\ComfyUI_TiledKSampler module for custom nodes: No module named 'comfy.controlnet'

Any idea what's missing here? I checked other controlnet themed nodes via manager but didn't look like anything obvious that would resolve it.

get_additional_models() missing 1 required positional argument: 'dtype'

A workflow that was previously working is now failing with:

Error occurred when executing BNK_TiledKSampler:

get_additional_models() missing 1 required positional argument: 'dtype'

  File "D:\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 311, in sample
    return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
  File "D:\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 116, in sample_common
    modelPatches = comfy.sample.get_additional_models(positive, negative)

cannot use "ramdom" shuffling

The other 3 strategies all work but random will thorw an error.
Trying to do 1024x1024 tiles on a 2048x2048 latent image?

Error occurred when executing BNK_TiledKSamplerAdvanced:

pixel_unshuffle expects height to be divisible by downscale_factor, but input.size(-2)=200 is not divisible by 16

`KeyError: 1` with Area Mask conditioning.

I'm attempting to do some very simple regional conditioning with a mask, but I keep getting the error message KeyError: 1 whenever I try to run my prompt. I've attempted it with ComfyUI's regular ksampler and the mask conditioning works, but with tileksampler, it fails:

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "/home/####/comfy/ComfyUI/execution.py", line 155, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/####/comfy/ComfyUI/execution.py", line 85, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/####/comfy/ComfyUI/execution.py", line 78, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/####/comfy/ComfyUI/custom_nodes/ComfyUI_TiledKSampler/nodes.py", line 320, in sample
    return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/####/comfy/ComfyUI/custom_nodes/ComfyUI_TiledKSampler/nodes.py", line 265, in sample_common
    pos = [slice_cond(tile_h, tile_h_len, tile_w, tile_w_len, c, area) for c, area in zip(pos, spatial_conds_pos)]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/####/comfy/ComfyUI/custom_nodes/ComfyUI_TiledKSampler/nodes.py", line 265, in <listcomp>
    pos = [slice_cond(tile_h, tile_h_len, tile_w, tile_w_len, c, area) for c, area in zip(pos, spatial_conds_pos)]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/####/comfy/ComfyUI/custom_nodes/ComfyUI_TiledKSampler/nodes.py", line 55, in slice_cond
    cond[1]['mask'] = new_mask
    ~~~~^^^
KeyError: 1

I've attached the workflow's JSON file: KeyError1.json

Can't use 2M SDE sampler

it create pixaled tiles at 4 corner. I've tried both normal/karras with padding/random tile method
Edit: SDE++ also doesn't work

not working after comfyui update

after updating comfyui from git getting this:

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "/home/myky/Stažené/git/ComfyUI/execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myky/Stažené/git/ComfyUI/execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myky/Stažené/git/ComfyUI/execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myky/Stažené/git/ComfyUI/custom_nodes/ComfyUI_TiledKSampler/nodes.py", line 312, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myky/Stažené/git/ComfyUI/custom_nodes/ComfyUI_TiledKSampler/nodes.py", line 123, in sample_common
comfy.model_management.load_models_gpu([model] + modelPatches, comfy.model_management.batch_area_memory(noise.shape[0] * noise.shape[2] * noise.shape[3]) + inference_memory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'comfy.model_management' has no attribute 'batch_area_memory'

seems like comfyui update killed it :(

'T2IAdapter' object has no attribute 'control_model'

other no tiled KSampler work well , but TiledKSampler not work.

Error occurred when executing BNK_TiledKSamplerAdvanced:

'T2IAdapter' object has no attribute 'control_model'

File "D:\ComfyUI_Portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\ComfyUI_Portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\ComfyUI_Portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\ComfyUI_Portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 346, in sample
return sample_common(model, add_noise, noise_seed, tile_width, tile_height, tiling_strategy, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0, preview= preview == 'enable')
File "D:\ComfyUI_Portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 250, in sample_common
slice_cnet(tile_h, tile_h_len, tile_w, tile_w_len, m, img)
File "D:\ComfyUI_Portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 86, in slice_cnet
model.cond_hint = tiling.get_slice(img, h8, h_len8, w8, w_len8).to(model.control_model.dtype).to(model.device)

error occurred when executing BNK_TiledKSampler:

rror occurred when executing BNK_TiledKSampler:

module 'comfy.sample' has no attribute 'convert_cond'

File "E:\stable_diffusion\ComfyUI_windows_portable_nvidia_cu118_or_cpu_23_09_2023\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "E:\stable_diffusion\ComfyUI_windows_portable_nvidia_cu118_or_cpu_23_09_2023\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "E:\stable_diffusion\ComfyUI_windows_portable_nvidia_cu118_or_cpu_23_09_2023\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "E:\stable_diffusion\ComfyUI_windows_portable_nvidia_cu118_or_cpu_23_09_2023\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 312, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
File "E:\stable_diffusion\ComfyUI_windows_portable_nvidia_cu118_or_cpu_23_09_2023\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 120, in sample_common
positive_copy = comfy.sample.convert_cond(positive)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.