onediff
onediff copied to clipboard
Upsampling fails when trying to make Kohya Hires fix compatible with oneflow
Describe the bug
I tried to modify the ComfyUI Kohya Hires fix (PatchModelAddDownscale) node to support oneflow, but I ran into an issue with upsampling that I can't resolve.
At first, I encountered this:
File "/home/sd/git/ComfyUI/comfy_extras/nodes_model_downscale.py", line 28, in input_block_patch
sigma = transformer_options["sigmas"][0].item()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Only eager scalar tensor support GetItem.
and another issue with the if statement since it attempts to convert the lazy tensor value into a boolean. To avoid needing the tensor values while the graph is being built, I modified the code to use only tensor calculations by using booleans as weights:
diff --git a/comfy_extras/nodes_model_downscale.py b/comfy_extras/nodes_model_downscale.py
index 48bcc68..ce593f0 100644
--- a/comfy_extras/nodes_model_downscale.py
+++ b/comfy_extras/nodes_model_downscale.py
@@ -1,5 +1,6 @@
import torch
import comfy.utils
+import pdb
class PatchModelAddDownscale:
upscale_methods = ["bicubic", "nearest-exact", "bilinear", "area", "bislerp"]
@@ -25,9 +26,10 @@ class PatchModelAddDownscale:
def input_block_patch(h, transformer_options):
if transformer_options["block"][1] == block_number:
- sigma = transformer_options["sigmas"][0].item()
- if sigma <= sigma_start and sigma >= sigma_end:
- h = comfy.utils.common_upscale(h, round(h.shape[-1] * (1.0 / downscale_factor)), round(h.shape[-2] * (1.0 / downscale_factor)), downscale_method, "disabled")
+ sigma = transformer_options["sigmas"][0]
+ w = sigma.le(sigma_start).logical_and(sigma.ge(sigma_end))
+ downscaled = comfy.utils.common_upscale(h, round(h.shape[-1] * (1.0 / downscale_factor)), round(h.shape[-2] * (1.0 / downscale_factor)), downscale_method, "disabled")
+ h = h * w.logical_not() + downscaled * w
return h
def output_block_patch(h, hsp, transformer_options):
I'm pretty sure this would otherwise work, but I get this error when the common_upscale function runs:
File "/home/sd/git/ComfyUI/comfy_extras/nodes_model_downscale.py", line 31, in input_block_patch
downscaled = comfy.utils.common_upscale(h, round(h.shape[-1] * (1.0 / downscale_factor)), round(h.shape[-2] * (1.0 / downscale_factor)), downscale_method, "disabled")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/utils.py", line 430, in common_upscale
return torch.nn.functional.interpolate(s, size=(height, width), mode=upscale_method)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/torch/nn/functional.py", line 4046, in interpolate
return torch._C._nn.upsample_bicubic2d(input, output_size, align_corners, scale_factors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: upsample_bicubic2d() received an invalid combination of arguments - got (Tensor, tuple, bool, NoneType), but expected one of:
* (Tensor input, tuple of ints output_size, bool align_corners, tuple of floats scale_factors)
didn't match because some of the arguments have invalid types: (Tensor, tuple of (int, int), bool, NoneType)
* (Tensor input, tuple of ints output_size, bool align_corners, float scales_h, float scales_w, *, Tensor out)
I don't know how to fix this; common_upscale calls torch.nn.interpolate
which requires that either output_size
or scale_factors
be None, but for some reason I'm getting this type error about scale_factors being None, which shouldn't happen.
As far as I understand, oneflow does some kind of magic under the hood to hijack torch and substitutes its own implementation. Is this something that's just not supported, or is there an actual bug here?
Your environment
OS
RHEL 9, Torch 2.2.0
OneDiff git commit id
954f759955556f8b23d1dd70f5290808c0c78e92
OneFlow version info
Run python -m oneflow --doctor
and paste it here.
path: ['/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow']
version: 0.9.1.dev20240406+cu121
git_commit: 710818c
cmake_build_type: Release
rdma: True
mlir: True
enterprise: False
How To Reproduce
Steps to reproduce the behavior(code or script): Apply the diff in the description and then run any basic workflow with Onediff and PatchModelAddDownscale downscale.json
The complete error message
Building a graph for <class 'register_comfy.openaimodel.UNetModel'> ...
[ERROR](GRAPH:OneflowGraph_0:OneflowGraph) building graph got error.
Exception in __call__: e=TypeError("upsample_bicubic2d() received an invalid combination of arguments - got (Tensor, tuple, bool, NoneType), but expected one of:\n * (Tensor input, tuple of ints output_size, bool align_corners, tuple of floats scale_factors)\n didn't match because some of the arguments have invalid types: (\x1b[32;1mTensor\x1b[0m, \x1b[31;1mtuple of (int, int)\x1b[0m, \x1b[32;1mbool\x1b[0m, \x1b[31;1mNoneType\x1b[0m)\n * (Tensor input, tuple of ints output_size, bool align_corners, float scales_h, float scales_w, *, Tensor out)\n")
Recompile oneflow module ...
Building a graph for <class 'register_comfy.openaimodel.UNetModel'> ...
[ERROR](GRAPH:OneflowGraph_1:OneflowGraph) building graph got error.
0%| | 0/20 [00:07<?, ?it/s]
!!! Exception during processing !!!
Traceback (most recent call last):
File "/home/sd/git/onediff/src/onediff/infer_compiler/with_oneflow_compile.py", line 186, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/utils/graph_management_utils.py", line 86, in wrapper
ret = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/with_oneflow_compile.py", line 274, in __call__
output = dpl_graph(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 295, in __call__
self._compile(*args, **kwargs)
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 861, in _compile
return self._dynamic_input_graph_cache._compile(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/cache.py", line 121, in _compile
return graph._compile(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 865, in _compile
return self._compile_new(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 884, in _compile_new
_, eager_outputs = self.build_graph(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1432, in build_graph
outputs = self.__build_graph(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1580, in __build_graph
outputs = self.build(*lazy_args, **lazy_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/with_oneflow_compile.py", line 367, in build
return self.model(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/proxy.py", line 188, in __call__
result = self.__block_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/proxy.py", line 238, in __block_forward
result = unbound_forward_of_module_instance(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/custom_nodes/onediff_comfy_nodes/infer_compiler_registry/register_comfy/openaimodel.py", line 116, in forward
h = p(h, transformer_options)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy_extras/nodes_model_downscale.py", line 31, in input_block_patch
downscaled = comfy.utils.common_upscale(h, round(h.shape[-1] * (1.0 / downscale_factor)), round(h.shape[-2] * (1.0 / downscale_factor)), downscale_method, "disabled")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/utils.py", line 430, in common_upscale
return torch.nn.functional.interpolate(s, size=(height, width), mode=upscale_method)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/torch/nn/functional.py", line 4046, in interpolate
return torch._C._nn.upsample_bicubic2d(input, output_size, align_corners, scale_factors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: upsample_bicubic2d() received an invalid combination of arguments - got (Tensor, tuple, bool, NoneType), but expected one of:
* (Tensor input, tuple of ints output_size, bool align_corners, tuple of floats scale_factors)
didn't match because some of the arguments have invalid types: (Tensor, tuple of (int, int), bool, NoneType)
* (Tensor input, tuple of ints output_size, bool align_corners, float scales_h, float scales_w, *, Tensor out)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sd/git/ComfyUI/execution.py", line 314, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/execution.py", line 192, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/execution.py", line 167, in map_node_over_list
results.append(getattr(obj, func)(**input_dict))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/nodes.py", line 1343, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/nodes.py", line 1313, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/control_reference.py", line 47, in refcn_sample
return orig_comfy_sample(model, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/custom_nodes/ComfyUI-Impact-Pack/modules/impact/sample_error_enhancer.py", line 9, in informative_sample
return original_sample(*args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/sample.py", line 37, in sample
samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 756, 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 "/home/sd/git/ComfyUI/comfy/samplers.py", line 658, in sample
return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 645, in sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 624, in inner_sample
samples = sampler.sample(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 535, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/k_diffusion/sampling.py", line 137, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 272, in __call__
out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 611, in __call__
return self.predict_noise(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 614, in predict_noise
return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 258, in sampling_function
out = calc_cond_batch(model, conds, x, timestep, model_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/samplers.py", line 218, in calc_cond_batch
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/model_base.py", line 97, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/utils/args_tree_util.py", line 50, in wrapper
output = func(self, *mapped_args, **mapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/with_oneflow_compile.py", line 192, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/utils/graph_management_utils.py", line 86, in wrapper
ret = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/with_oneflow_compile.py", line 274, in __call__
output = dpl_graph(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 295, in __call__
self._compile(*args, **kwargs)
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 861, in _compile
return self._dynamic_input_graph_cache._compile(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/cache.py", line 121, in _compile
return graph._compile(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 865, in _compile
return self._compile_new(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 884, in _compile_new
_, eager_outputs = self.build_graph(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1432, in build_graph
outputs = self.__build_graph(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1580, in __build_graph
outputs = self.build(*lazy_args, **lazy_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/onediff/src/onediff/infer_compiler/with_oneflow_compile.py", line 367, in build
return self.model(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/proxy.py", line 188, in __call__
result = self.__block_forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/oneflow/nn/graph/proxy.py", line 238, in __block_forward
result = unbound_forward_of_module_instance(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/custom_nodes/onediff_comfy_nodes/infer_compiler_registry/register_comfy/openaimodel.py", line 116, in forward
h = p(h, transformer_options)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy_extras/nodes_model_downscale.py", line 31, in input_block_patch
downscaled = comfy.utils.common_upscale(h, round(h.shape[-1] * (1.0 / downscale_factor)), round(h.shape[-2] * (1.0 / downscale_factor)), downscale_method, "disabled")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/git/ComfyUI/comfy/utils.py", line 430, in common_upscale
return torch.nn.functional.interpolate(s, size=(height, width), mode=upscale_method)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sd/venvs/webui/lib/python3.11/site-packages/torch/nn/functional.py", line 4046, in interpolate
return torch._C._nn.upsample_bicubic2d(input, output_size, align_corners, scale_factors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: upsample_bicubic2d() received an invalid combination of arguments - got (Tensor, tuple, bool, NoneType), but expected one of:
* (Tensor input, tuple of ints output_size, bool align_corners, tuple of floats scale_factors)
didn't match because some of the arguments have invalid types: (Tensor, tuple of (int, int), bool, NoneType)
* (Tensor input, tuple of ints output_size, bool align_corners, float scales_h, float scales_w, *, Tensor out)
Additional context
Add any other context about the problem here.
The current compiler backend needs you to do some carefull work to compile a new model.
We are working on a new compiler backend which is more dynamic to support there special cases. It will be released in the v1.1