Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webui 生成非32倍分辨率的图片会报错 #832

Closed
huan085128 opened this issue Apr 19, 2024 · 2 comments
Closed

webui 生成非32倍分辨率的图片会报错 #832

huan085128 opened this issue Apr 19, 2024 · 2 comments
Assignees
Labels
Request-bug Something isn't working sig-sdwebui

Comments

@huan085128
Copy link

Describe the bug

webui 生成非32倍分辨率的图片会报错,比如720x1280,生成1024x1024则不会

Your environment

linux

OneDiff git commit id is d06440a

sd webui git commit id is adadb4e3c7382bf3e4f7519126cd6c70f4f8557b

OneFlow version info

path: ['/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow']
version: 0.9.1.dev20240418+cu118
git_commit: 67341c9
cmake_build_type: Release
rdma: True
mlir: True
enterprise: False

参考了这里面的使用方法:https://github.com/siliconflow/onediff/tree/main/onediff_sd_webui_extensions

The complete error message

Startup time: 95.8s (import torch: 3.6s, import gradio: 0.7s, setup paths: 1.7s, initialize shared: 0.3s, other imports: 0.9s, list SD models: 1.5s, load scripts: 81.7s, create ui: 0.8s, gradio launch: 2.9s, app_started_callback: 1.6s).
  0%|                                                                                                                                             | 0/30 [00:00<?, ?it/s]WARNING [2024-04-19 05:42:53] /mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py:187 - Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING:ONEDIFF:Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING [2024-04-19 05:42:53] /mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py:187 - Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING:ONEDIFF:Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING [2024-04-19 05:42:54] /mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py:187 - Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING:ONEDIFF:Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING [2024-04-19 05:42:57] /mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py:187 - Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
WARNING:ONEDIFF:Failed to update obj_entity in place. Exception: Not support <function CondFunc.__new__.<locals>.<lambda> at 0x7f9537726340> with parameters Module: <module 'modules.sd_hijack_utils' from '/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py'>
[ERROR](GRAPH:OneflowGraph_0:OneflowGraph) building graph got error.
ERROR [2024-04-19 05:42:59] /mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/utils.py:23 - Exception in forward: e=RuntimeError('\x1b[1m\x1b[38;2;255;000;000mError\x1b[0m: Sizes of tensors must match except in dimension 1. Got 45 and 46 is expected in dimension 3.\n')
ERROR:ONEDIFF:Exception in forward: e=RuntimeError('\x1b[1m\x1b[38;2;255;000;000mError\x1b[0m: Sizes of tensors must match except in dimension 1. Got 45 and 46 is expected in dimension 3.\n')
WARNING [2024-04-19 05:42:59] /mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/utils.py:24 - Recompile oneflow module ...
WARNING:ONEDIFF:Recompile oneflow module ...
[ERROR](GRAPH:OneflowGraph_1:OneflowGraph) building graph got error.
  0%|                                                                                                                                             | 0/30 [00:10<?, ?it/s]
*** Error completing request
*** Arguments: ('task(chgyifgfkh3lzgm)', <gradio.routes.Request object at 0x7f92b83cd890>, 'a girl,', '', [], 1, 1, 7, 1280, 720, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 4, 30, 'DPM++ 2M', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 'DemoFusion', False, 128, 64, 4, 2, False, 10, 1, 1, 64, False, True, 3, 1, 1, True, 0.85, 0.6, 4, False, False, 3072, 192, True, True, True, False, <scripts.animatediff_ui.AnimateDiffProcess object at 0x7f92b83cd8d0>, UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False, False, None, None, False, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/utils.py", line 21, in wrapper
        return func(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/utils/graph_management_utils.py", line 91, in wrapper
        ret = func(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/deployable_module.py", line 99, in forward
        output = dpl_graph(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 295, in __call__
        self._compile(*args, **kwargs)
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 861, in _compile
        return self._dynamic_input_graph_cache._compile(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/cache.py", line 121, in _compile
        return graph._compile(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 865, in _compile
        return self._compile_new(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 884, in _compile_new
        _, eager_outputs = self.build_graph(*args, **kwargs)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1429, in build_graph
        outputs = self.__build_graph(*args, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1577, in __build_graph
        outputs = self.build(*lazy_args, **lazy_kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/graph.py", line 19, in build
        return self.model(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/proxy.py", line 188, in __call__
        result = self.__block_forward(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/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 "/mnt/private/fuhuan/stable-diffusion-webui/extensions/onediff_sd_webui_extensions/compile_sgm.py", line 38, in forward
        h = flow.cat([h, hs.pop()], dim=1)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Error: Sizes of tensors must match except in dimension 1. Got 45 and 46 is expected in dimension 3.


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/call_queue.py", line 36, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/txt2img.py", line 106, in txt2img
        processed = modules.scripts.scripts_txt2img.run(p, *p.script_args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/scripts.py", line 773, in run
        processed = script.run(p, *script_args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/extensions/onediff_sd_webui_extensions/scripts/onediff.py", line 196, in run
        proc = process_images(p)
               ^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/processing.py", line 845, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/processing.py", line 981, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/processing.py", line 1328, in sample
        samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 218, in sample
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_samplers_common.py", line 272, in launch_sampling
        return func()
               ^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 218, in <lambda>
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 594, in sample_dpmpp_2m
        denoised = model(x, sigmas[i] * s_in, **extra_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_samplers_cfg_denoiser.py", line 237, in forward
        x_out = self.inner_model(x_in, sigma_in, cond=make_condition_dict(cond_in, image_cond_in))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 112, in forward
        eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 138, in get_eps
        return self.inner_model.apply_model(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_models_xl.py", line 44, in apply_model
        return self.model(x, t, cond)
               ^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py", line 18, in <lambda>
        setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
                                                                     ^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/modules/sd_hijack_utils.py", line 32, in __call__
        return self.__orig_func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/stable-diffusion-webui/repositories/generative-models/sgm/modules/diffusionmodules/wrappers.py", line 28, in forward
        return self.diffusion_model(
               ^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1561, in _call_impl
        result = forward_call(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/utils/online_quantization_utils.py", line 48, in wrapper
        output = func(self, *args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/utils/args_tree_util.py", line 50, in wrapper
        output = func(self, *mapped_args, **mapped_kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/utils.py", line 27, in wrapper
        return func(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/utils/graph_management_utils.py", line 91, in wrapper
        ret = func(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/deployable_module.py", line 99, in forward
        output = dpl_graph(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 295, in __call__
        self._compile(*args, **kwargs)
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 861, in _compile
        return self._dynamic_input_graph_cache._compile(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/cache.py", line 121, in _compile
        return graph._compile(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 865, in _compile
        return self._compile_new(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 884, in _compile_new
        _, eager_outputs = self.build_graph(*args, **kwargs)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1429, in build_graph
        outputs = self.__build_graph(*args, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/graph.py", line 1577, in __build_graph
        outputs = self.build(*lazy_args, **lazy_kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/mnt/private/fuhuan/ComfyUI/onediff/src/onediff/infer_compiler/oneflow/graph.py", line 19, in build
        return self.model(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/lib/python3.11/site-packages/oneflow/nn/graph/proxy.py", line 188, in __call__
        result = self.__block_forward(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/root/miniconda3/envs/webui-onediff/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 "/mnt/private/fuhuan/stable-diffusion-webui/extensions/onediff_sd_webui_extensions/compile_sgm.py", line 38, in forward
        h = flow.cat([h, hs.pop()], dim=1)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Error: Sizes of tensors must match except in dimension 1. Got 45 and 46 is expected in dimension 3.
@yy-fisher
Copy link

I also encountered the same problem

@strint strint added Request-bug Something isn't working sig-sdwebui labels Apr 25, 2024
nono-Sang added a commit that referenced this issue May 6, 2024
存在的问题:在 sd-webui 中,onediff 仅支持 64 倍分辨率的图片,对应的 issue 是
#832 (本质原因是,非 64 倍分辨率时,unet
上下采样所产生的张量维度误差会导致 `cat` 操作失败)。

解决方法:发现 sd-webui 是通过劫持 `torch.cat` 来应对这一问题以支持 8 倍分辨率的,所以对应地,只需要在 onediff
中对 `oneflow.cat` 进行劫持即可。
@doombeaker
Copy link
Contributor

doombeaker commented May 6, 2024

it has been fixed by #847 and #863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request-bug Something isn't working sig-sdwebui
Projects
None yet
Development

No branches or pull requests

4 participants