lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.76k stars 180 forks source link

Ultimate SD upscale - Cannot set version_counter for inference tensor[Bug]: #503

Open nicodem09 opened 1 month ago

nicodem09 commented 1 month ago

Checklist

What happened?

When trying to use Ultimate SD upscale 4x-UltraSharp DAT x2 DAT x3 DAT x4 R-ESRGAN 4x+ R-ESRGAN 4x+ Anime6B

it gives me this error "Cannot set version_counter for inference tensor" this started yesterday after the new update image

Steps to reproduce the problem

Go to img2img and enable control net tile use the script Ultimate SD upscale choose any of these : -4x-UltraSharp -DAT x2 -DAT x3 -DAT x4 -R-ESRGAN 4x+ -R-ESRGAN 4x+ Anime6B

And Click generate

What should have happened?

It should generate and work properly

What browsers do you use to access the UI ?

No response

Sysinfo

sysinfo-2024-07-28-06-28.json

Console logs

Canva size: 1024x1024
Image size: 512x512
Scale factor: 2
Upscaling iteration 1 with scale factor 2
tiled upscale:   0%|                                                                             | 0/9 [00:00<?, ?it/s]
*** Error completing request
*** Arguments: ('task(3zt7ahxm5zvhsxg)', <gradio.routes.Request object at 0x000001697FF94E20>, 0, 'high quality, ', '', [], <PIL.Image.Image image mode=RGBA size=512x512 at 0x16981A57A00>, None, None, None, None, None, None, 4, 0, 1, 1, 1, 7, 1.5, 0.4, 0.0, 512, 512, 1, 0, 0, 32, 0, '', '', '', [], False, [], '', 'upload', None, 10, False, 1, 0.5, 4, 0, 0.5, 2, 20, 'DPM++ 2M', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, {'ad_model': 'face_yolov8n.pt', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, 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, 512, 64, True, True, True, False, ControlNetUnit(is_ui=True, input_mode=<InputMode.SIMPLE: 'simple'>, batch_images='', output_dir='', loopback=False, enabled=True, module='tile_resample', model='control_v11f1e_sd15_tile [a371b31b]', weight=1.0, image={'image': array([[[18, 17, 22],
***         [ 9,  8, 14],
***         [ 5,  4,  9],
***         ...,
***         [ 5,  7, 11],
***         [ 6,  7, 12],
***         [ 7,  9, 13]],
***
***        [[13, 15, 19],
***         [ 3,  5,  8],
***         [ 1,  2,  5],
***         ...,
***         [ 1,  5,  8],
***         [ 0,  4,  7],
***         [ 5,  7, 12]],
***
***        [[15, 15, 20],
***         [ 2,  1,  6],
***         [ 3,  3,  7],
***         ...,
***         [ 2,  4,  8],
***         [ 1,  5,  8],
***         [ 3,  6, 11]],
***
***        ...,
***
***        [[20, 21, 27],
***         [ 6,  8, 15],
***         [ 5,  9, 15],
***         ...,
***         [17, 22, 29],
***         [16, 22, 28],
***         [19, 22, 31]],
***
***        [[18, 19, 26],
***         [ 7, 10, 16],
***         [ 3,  9, 12],
***         ...,
***         [16, 24, 28],
***         [16, 23, 28],
***         [20, 23, 31]],
***
***        [[22, 22, 29],
***         [11, 11, 19],
***         [ 8,  9, 16],
***         ...,
***         [21, 23, 31],
***         [22, 23, 32],
***         [23, 24, 31]]], dtype=uint8), 'mask': array([[[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        ...,
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]]], dtype=uint8)}, resize_mode=<ResizeMode.RESIZE: 'Just Resize'>, low_vram=True, processor_res=512, threshold_a=1.0, threshold_b=0.5, guidance_start=0.0, guidance_end=1.0, pixel_perfect=True, control_mode=<ControlMode.BALANCED: 'Balanced'>, inpaint_crop_input_image=False, hr_option=<HiResFixOption.BOTH: 'Both'>, save_detected_map=True, advanced_weighting=None, effective_region_mask=None, pulid_mode=<PuLIDMode.FIDELITY: 'Fidelity'>, union_control_type=<ControlNetUnionControlType.TILE: 'Tile'>, ipadapter_input=None, mask=None, batch_mask_dir=None, animatediff_batch=False, batch_modifiers=[], batch_image_files=[], batch_keyframe_idx=None), ControlNetUnit(is_ui=True, input_mode=<InputMode.SIMPLE: 'simple'>, batch_images='', output_dir='', loopback=False, enabled=False, module='none', model='None', weight=1.0, image=None, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, low_vram=False, processor_res=-1, threshold_a=-1.0, threshold_b=-1.0, guidance_start=0.0, guidance_end=1.0, pixel_perfect=False, control_mode=<ControlMode.BALANCED: 'Balanced'>, inpaint_crop_input_image=False, hr_option=<HiResFixOption.BOTH: 'Both'>, save_detected_map=True, advanced_weighting=None, effective_region_mask=None, pulid_mode=<PuLIDMode.FIDELITY: 'Fidelity'>, union_control_type=<ControlNetUnionControlType.UNKNOWN: 'Unknown'>, ipadapter_input=None, mask=None, batch_mask_dir=None, animatediff_batch=False, batch_modifiers=[], batch_image_files=[], batch_keyframe_idx=None), ControlNetUnit(is_ui=True, input_mode=<InputMode.SIMPLE: 'simple'>, batch_images='', output_dir='', loopback=False, enabled=False, module='none', model='None', weight=1.0, image=None, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, low_vram=False, processor_res=-1, threshold_a=-1.0, threshold_b=-1.0, guidance_start=0.0, guidance_end=1.0, pixel_perfect=False, control_mode=<ControlMode.BALANCED: 'Balanced'>, inpaint_crop_input_image=False, hr_option=<HiResFixOption.BOTH: 'Both'>, save_detected_map=True, advanced_weighting=None, effective_region_mask=None, pulid_mode=<PuLIDMode.FIDELITY: 'Fidelity'>, union_control_type=<ControlNetUnionControlType.UNKNOWN: 'Unknown'>, ipadapter_input=None, mask=None, batch_mask_dir=None, animatediff_batch=False, batch_modifiers=[], batch_image_files=[], batch_keyframe_idx=None), '* `CFG Scale` should be 2 or lower.', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, 'start', '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False, None, None, False, None, None, False, None, None, False, 50, '<p style="margin-bottom:0.75em">Will upscale the image depending on the selected target size type</p>', 512, 0, 8, 32, 64, 0.35, 32, 3, True, 0, False, 8, 0, 2, 2048, 2048, 2) {}
    Traceback (most recent call last):
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\call_queue.py", line 74, in f
        res = list(func(*args, **kwargs))
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\call_queue.py", line 53, in f
        res = func(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\img2img.py", line 240, in img2img
        processed = modules.scripts.scripts_img2img.run(p, *args)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\scripts.py", line 780, in run
        processed = script.run(p, *script_args)
      File "D:\AI\stable-diffusion-webui-amdgpu\extensions\ultimate-upscale-for-automatic1111\scripts\ultimate-upscale.py", line 558, in run
        upscaler.upscale()
      File "D:\AI\stable-diffusion-webui-amdgpu\extensions\ultimate-upscale-for-automatic1111\scripts\ultimate-upscale.py", line 83, in upscale
        self.image = self.upscaler.scaler.upscale(self.image, value, self.upscaler.data_path)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\upscaler.py", line 68, in upscale
        img = self.do_upscale(img, selected_model)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\esrgan_model.py", line 36, in do_upscale
        return esrgan_upscale(model, img)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\esrgan_model.py", line 57, in esrgan_upscale
        return upscale_with_model(
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\upscaler_utils.py", line 74, in upscale_with_model
        output = upscale_pil_patch(model, tile)
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\upscaler_utils.py", line 48, in upscale_pil_patch
        return torch_bgr_to_pil_image(model(tensor))
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\spandrel\__helpers\model_descriptor.py", line 472, in __call__
        output = self._call_fn(self.model, image)
      File "D:\AI\stable-diffusion-webui-amdgpu\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 "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\spandrel\architectures\ESRGAN\arch\RRDB.py", line 142, in forward
        return self.model(x)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
        input = module(input)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
        return forward_call(*args, **kwargs)
      File "D:\AI\stable-diffusion-webui-amdgpu\extensions-builtin\Lora\networks.py", line 599, in network_Conv2d_forward
        return originals.Conv2d_forward(self, input)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
      File "D:\AI\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\dml\amp\autocast_mode.py", line 43, in <lambda>
        setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: forward(op, args, kwargs))
      File "D:\AI\stable-diffusion-webui-amdgpu\modules\dml\amp\autocast_mode.py", line 15, in forward
        return op(*args, **kwargs)
    RuntimeError: Cannot set version_counter for inference tensor

Additional information

I updated my stable diffusion yesterday's update

phataku commented 1 month ago

I have the same error when I try to upscale an image. Clipboard01 Clipboard02

I don't know enough to be of any assistance. I just wanted you to know that you're not the only one.

nicodem09 commented 1 month ago

Thank you, Idk what happened I reinstalled everything 3 times now, no luck :(

phataku commented 1 month ago

I was going to do a Git reset to an older commit, but I'm gonna wait. If this problem isn't an isolated thing, then I imagine a fix will be coming.

lshqqytiger commented 1 month ago

It is an old bug of DirectML. (but they don't fix it)

nicodem09 commented 1 month ago

It is an old bug of DirectML. (but they don't fix it)

  • If you are using Navi cards, try ZLUDA.
  • If not, checkout 1.9.3.
git checkout tags/v1.9.3-amd

This is what I did earlier and it's working fine again. I would recommend this fix to those with the same problem.

Thank you for your hard work.

nicodem09 commented 1 month ago
  • Navi cards

I have a 5500xt would this work on ZLUDA?

pw405 commented 1 month ago

Can confirm: Ultimate SD Upscale works on most recent version using Zluda on 7900XTX (Navi31).

image

phataku commented 1 month ago

Can confirm: Ultimate SD Upscale works on most recent version using Zluda on 7900XTX (Navi31).

image

Think it would work on 7900XT without that extra "X"? Website says it's Navi31. Gonna try it, and report back.

pw405 commented 1 month ago

Can confirm: Ultimate SD Upscale works on most recent version using Zluda on 7900XTX (Navi31). image

Think it would work on 7900XT without that extra "X"? Website says it's Navi31. Gonna try it, and report back.

Oh for sure, all features should be identical - same generation of chip, the XT just has a few less cores and VRAM.

nicodem09 commented 1 month ago

Can confirm: Ultimate SD Upscale works on most recent version using Zluda on 7900XTX (Navi31).

image

however the issue occurs when using control net tile model, and Ultimate SD upscaler with ESRGAN and 4xUltraSharp

nicodem09 commented 1 month ago

I made my rx5500xt run with zluda and it's working fine now and it uses less vram and ram. image

pw405 commented 1 month ago

Awesome! How is the install process now? Do you still need to edit system variables, download ROCM, etc. etc? I wanted to walk a friend through it, but it has been so long since I installed on my system I figured it has changed.

Felix-JS commented 1 month ago

I made my rx5500xt run with zluda and it's working fine now and it uses less vram and ram. image

Can you tell us how you did it? I have the same issue and want to try this zluda thing

Felix-JS commented 1 month ago

I've managed to install zluda and run automatic1111 with it but now I get very big times for generating txt2img. While before it took less than 1 min, now it takes around 5-6 mins for 1 pic only. I guess I'll stick to directml and try to upscale my images on comfyui until they fix this this

pw405 commented 1 month ago

I've managed to install zluda and run automatic1111 with it but now I get very big times for generating txt2img. While before it took less than 1 min, now it takes around 5-6 mins for 1 pic only. I guess I'll stick to directml and try to upscale my images on comfyui until they fix this this

That's odd.... I saw at least a 200% performance increase with Zluda vs. DirectML. Are you sure it isn't running on CPU?

Are you using any optimizations like Scaled Dot Product?

For reference, on a 7900 XTX, using first order sampler, say DPM++ 2M Karras, I would get about 3 iterations per second on common SDXL models like Juggernaut. Typical 832 X 1216 Text to Image takes about 30 seconds all said and done.

nicodem09 commented 1 month ago

Awesome! How is the install process now? Do you still need to edit system variables, download ROCM, etc. etc? I wanted to walk a friend through it, but it has been so long since I installed on my system I figured it has changed.

Yes, It's the same process, then I installed SDnext and run it with zluda by "--use-zluda" after it installed everything and confirming it works, I copied the venv folder from SDnext and pasted it to this automatic1111 by lshqqytiger and run it using --use-zluda and it's working great.

nicodem09 commented 1 month ago

I've managed to install zluda and run automatic1111 with it but now I get very big times for generating txt2img. While before it took less than 1 min, now it takes around 5-6 mins for 1 pic only. I guess I'll stick to directml and try to upscale my images on comfyui until they fix this this

Make sure you run it with --use-zluda if it runs without adding anything aside from --use-zluda then its all good

CS1o commented 1 month ago

For anyone needing a full Guide to get ZLUDA to work with Auto1111, Comfyui, Forge and Fooocus, here are my Guides: https://github.com/CS1o/Stable-Diffusion-Info/wiki/Installation-Guides

@nicodem09 im interested which Rocm Lib files you used to replace the ones from HIP SDK. Then i can add it to the Guide as Supported Gpu.

nicodem09 commented 1 month ago

For anyone needing a full Guide to get ZLUDA to work with Auto1111, Comfyui, Forge and Fooocus, here are my Guides: https://github.com/CS1o/Stable-Diffusion-Info/wiki/Installation-Guides

@nicodem09 im interested which Rocm Lib files you used to replace the ones from HIP SDK. Then i can add it to the Guide as Supported Gpu.

I was using the same Lib as the one in your guid, it's the same one as you use for rx 580. Great Guide by the way, also I wanna ask about these arguments --update-check --skip-ort what do they do?

nicodem09 commented 1 month ago

Also is the AMD HIP SDK 6.1.2 better than the 5.7.1? I'm curios since I downloaded it before but SDNext was looking for 5.7.1 specifically and I resorted to installing it and uninstalled 6.1.2.

CS1o commented 1 month ago

Ah thx for letting me know. I will add the 5500xt to the supported gpu list.

--update-check checks at the start if your running the latest version of the webui and will notify you if not, inside the cmd. So people then can manually git pull if they dont want to have git pull in the webui-user.bat for auto update.

--skip-ort is for skipping the onnx Installation which is not required for Zluda.

Also I didn't noticed any performance improvements going from Rocm 5.7.1 to 6.1.2. Both should work fine but need different Zluda files.

nicodem09 commented 1 month ago

Both should work fine but need different Zluda files

Ah thx for letting me know. I will add the 5500xt to the supported gpu list.

--update-check checks at the start if your running the latest version of the webui and will notify you if not, inside the cmd. So people then can manually git pull if they dont want to have git pull in the webui-user.bat for auto update.

--skip-ort is for skipping the onnx Installation which is not required for Zluda.

Also I didn't noticed any performance improvements going from Rocm 5.7.1 to 6.1.2. Both should work fine but need different Zluda files.

I just tried the 6.1.2 also updated the zluda to the latest one but I get this error rocBLAS error: Could not load D:\Program Files\ROCm\6.1\bin\/rocblas/library/TensileLibrary.dat

it seems it's using reversed slashes to path, im not sure.

CS1o commented 1 month ago

When updating HIP SDK you have to re-set the Rocm Path in the System environment variables. If you added %HIP_PATH%bin it switched to the Rocm 5.7 path when saved. So delete the old path to Rocm 5.7 and then input %HIP_PATH%bin again. When saved it should use the path to 6.1

Then make sure you replaced the Rocm Library files again. Then restart the PC and relaunch the webui-user.bat.

nicodem09 commented 1 month ago

When updating HIP SDK you have to re-set the Rocm Path in the System environment variables. If you added %HIP_PATH%bin it switched to the Rocm 5.7 path when saved. So delete the old path to Rocm 5.7 and then input %HIP_PATH%bin again. When saved it should use the path to 6.1

Then make sure you replaced the Rocm Library files again. Then restart the PC and relaunch the webui-user.bat.

Okay I will try it now, thank you!

nicodem09 commented 1 month ago

@CS1o No luck, I went back to 5.7, all good tho

Voidbord commented 6 days ago

[Directml] So I "downgraded" the A1111 version to 1.8.0 but I keep getting the following error. The lastest version of A1111 has broken upscale but it works, whilst the older version doesnt work and gives the error:

Traceback (most recent call last): File "C:\Users\mbord_\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\utils\import_utils.py", line 830, in _get_module return importlib.import_module("." + modulename, self.name) File "C:\Users\mbord\AppData\Local\Programs\Python\Python310\lib\importlib__init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_framesremoved File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\pipelines\aura_flow\pipeline_auraflow.py", line 18, in from transformers import T5Tokenizer, UMT5EncoderModel ImportError: cannot import name 'UMT5EncoderModel' from 'transformers' (C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\transformers\init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\mbord_\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\utils\import_utils.py", line 830, in _get_module return importlib.import_module("." + modulename, self.name) File "C:\Users\mbord\AppData\Local\Programs\Python\Python310\lib\importlib__init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_framesremoved File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\pipelines\auto_pipeline.py", line 22, in from .aura_flow import AuraFlowPipeline File "", line 1075, in _handlefromlist File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\utils\import_utils.py", line 820, in getattr module = self._get_module(self._class_tomodule[name]) File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\utils\import_utils.py", line 832, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.pipelines.aura_flow.pipeline_auraflow because of the following error (look up to see its traceback): cannot import name 'UMT5EncoderModel' from 'transformers' (C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\transformers\init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\launch.py", line 48, in main() File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\launch.py", line 44, in main start() File "C:\Users\mbord_\Documents\stable-diffusion-webui-directml\modules\launchutils.py", line 696, in start import webui File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\webui.py", line 13, in initialize.imports() File "C:\Users\mbord_\Documents\stable-diffusion-webui-directml\modules\initialize.py", line 36, in imports sharedinit.initialize() File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\modules\shared_init.py", line 62, in initialize initializeonnx() File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\modules\onnx_impl__init.py", line 244, in initialize diffusers.pipelines.auto_pipeline.AUTO_TEXT2IMAGE_PIPELINESMAPPING["onnx-stable-diffusion"] = diffusers.OnnxStableDiffusionPipeline File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\utils\import_utils.py", line 818, in getattr__ value = self._getmodule(name) File "C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\utils\import_utils.py", line 832, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.pipelines.auto_pipeline because of the following error (look up to see its traceback): Failed to import diffusers.pipelines.aura_flow.pipeline_auraflow because of the following error (look up to see its traceback): cannot import name 'UMT5EncoderModel' from 'transformers' (C:\Users\mbord\Documents\stable-diffusion-webui-directml\venv\lib\site-packages\transformers__init__.py) Press any key to continue . . .

What to do? I tried to delete venv and reinstall it, but with no luck.

//OK, it seems that it's crucial to have diffusers==0.29.2(!!!) & transformers 4.30.2 & pydantic==1.10.18 and ofc clean installation of 1.9.3. and everything works like it used to