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

ReActor's Upscale tab broken #545

Open
3 tasks done
mr-september opened this issue Oct 15, 2024 · 0 comments
Open
3 tasks done

ReActor's Upscale tab broken #545

mr-september opened this issue Oct 15, 2024 · 0 comments
Labels
bug Something isn't working new

Comments

@mr-september
Copy link

mr-september commented Oct 15, 2024

First, confirm

  • I have read the instruction carefully
  • I have searched the existing issues
  • I have updated the extension to the latest version

What happened?

ReActor's upscale tab

  • with non-AI upscalers (e.g. lanczos, nearest): ValueError: images do not match
  • with AI upscalers (e.g. ESRGAN_4x) Cannot set version_counter for inference tensor

Steps to reproduce the problem

  1. Use ReActor's Upscale tab, choose any AI upscaler
  2. Press Generate
  3. Get one of the above error messages

Sysinfo

sysinfo-2024-10-15-09-40.json

Relevant console log

AI upscaler log:

20:33:11 - ReActor - STATUS - Upscaling with ESRGAN_4x scale = 1
tiled upscale:   0%|                                                                                   | 0/170 [00:00<?, ?it/s]
*** Error completing request
*** Arguments: ('task(f2iky7lqmt48g43)', 0.0, <PIL.Image.Image image mode=RGBA size=2996x1684 at 0x18BB12B7970>, None, '', '', True, False, 0.0, 4, 0.0, 512, 512, True, 'Lanczos', 'None', 0, False, 0.6, False, 0.6, 0.8, False, 0.5, 0.2, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Horizontal'], False, ['Deepbooru'], None, True, '0', '1', 'inswapper_128.onnx', 'CodeFormer', 0.6, True, 'ESRGAN_4x', 1, 1, 1, 0, 0, 0.8, 'CPU', False, 1, 'Liu Weiting.safetensors', '', None, False, False, 0.5, 0, 'tab_single') {}
    Traceback (most recent call last):
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 74, in f
        res = list(func(*args, **kwargs))
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 53, in f
        res = func(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\postprocessing.py", line 133, in run_postprocessing_webui
        return run_postprocessing(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\postprocessing.py", line 73, in run_postprocessing
        scripts.scripts_postproc.run(initial_pp, args)
      File "E:\stable-diffusion-webui-directml\modules\scripts_postprocessing.py", line 198, in run
        script.process(single_image, **process_args)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 688, in process
        result, output, swapped = swap_face(
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 616, in swap_face
        result_image, output, swapped = operate(source_img,target_img,target_img_orig,model,source_faces_index,faces_index,source_faces,target_faces,gender_source,gender_target,source_face,wrong_gender,source_age,source_gender,output,swapped,mask_face,entire_mask_image,enhancement_options,detection_options)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 821, in operate
        result_image = enhance_image(result_image, enhancement_options)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 218, in enhance_image
        result_image = upscale_image(result_image, enhancement_options)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 199, in upscale_image
        result_image = enhancement_options.upscaler.scaler.upscale(
      File "E:\stable-diffusion-webui-directml\modules\upscaler.py", line 68, in upscale
        img = self.do_upscale(img, selected_model)
      File "E:\stable-diffusion-webui-directml\modules\esrgan_model.py", line 36, in do_upscale
        return esrgan_upscale(model, img)
      File "E:\stable-diffusion-webui-directml\modules\esrgan_model.py", line 57, in esrgan_upscale
        return upscale_with_model(
      File "E:\stable-diffusion-webui-directml\modules\upscaler_utils.py", line 74, in upscale_with_model
        output = upscale_pil_patch(model, tile)
      File "E:\stable-diffusion-webui-directml\modules\upscaler_utils.py", line 48, in upscale_pil_patch
        return torch_bgr_to_pil_image(model(tensor))
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\spandrel\__helpers\model_descriptor.py", line 472, in __call__
        output = self._call_fn(self.model, image)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\spandrel\__helpers\model_descriptor.py", line 439, in <lambda>
        self._call_fn = call_fn or (lambda model, image: model(image))
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\spandrel\architectures\ESRGAN\arch\RRDB.py", line 142, in forward
        return self.model(x)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
        input = module(input)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\extensions-builtin\Lora\networks.py", line 599, in network_Conv2d_forward
        return originals.Conv2d_forward(self, input)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
      File "E:\stable-diffusion-webui-directml\modules\dml\amp\autocast_mode.py", line 43, in <lambda>
        setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: forward(op, args, kwargs))
      File "E:\stable-diffusion-webui-directml\modules\dml\amp\autocast_mode.py", line 15, in forward
        return op(*args, **kwargs)
    RuntimeError: Cannot set version_counter for inference tensor

---

Non-AI upscaler log:

20:35:45 - ReActor - STATUS - Upscaling with Lanczos scale = 1
*** Error completing request
*** Arguments: ('task(8i069thbs8du8cz)', 1.0, <PIL.Image.Image image mode=RGBA size=2996x1684 at 0x18BB270DCF0>, [<tempfile._TemporaryFileWrapper object at 0x0000018BB270D4E0>], '', '', True, False, 0.0, 4, 0.0, 512, 512, True, 'Lanczos', 'None', 0, False, 0.6, False, 0.6, 0.8, False, 0.5, 0.2, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Horizontal'], False, ['Deepbooru'], None, True, '0', '1', 'inswapper_128.onnx', 'CodeFormer', 0.6, True, 'Lanczos', 1, 1, 1, 0, 0, 0.8, 'CPU', False, 1, 'Liu Weiting.safetensors', '', None, False, False, 0.5, 0, 'tab_single') {}
    Traceback (most recent call last):
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 74, in f
        res = list(func(*args, **kwargs))
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 53, in f
        res = func(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\postprocessing.py", line 133, in run_postprocessing_webui
        return run_postprocessing(*args, **kwargs)
      File "E:\stable-diffusion-webui-directml\modules\postprocessing.py", line 73, in run_postprocessing
        scripts.scripts_postproc.run(initial_pp, args)
      File "E:\stable-diffusion-webui-directml\modules\scripts_postprocessing.py", line 198, in run
        script.process(single_image, **process_args)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 688, in process
        result, output, swapped = swap_face(
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 616, in swap_face
        result_image, output, swapped = operate(source_img,target_img,target_img_orig,model,source_faces_index,faces_index,source_faces,target_faces,gender_source,gender_target,source_face,wrong_gender,source_age,source_gender,output,swapped,mask_face,entire_mask_image,enhancement_options,detection_options)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 821, in operate
        result_image = enhance_image(result_image, enhancement_options)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 218, in enhance_image
        result_image = upscale_image(result_image, enhancement_options)
      File "E:\stable-diffusion-webui-directml\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 203, in upscale_image
        result_image = Image.blend(
      File "E:\stable-diffusion-webui-directml\venv\lib\site-packages\PIL\Image.py", line 3340, in blend
        return im1._new(core.blend(im1.im, im2.im, alpha))
    ValueError: images do not match

Additional information

No response

@mr-september mr-september added bug Something isn't working new labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new
Projects
None yet
Development

No branches or pull requests

1 participant