[GH-ISSUE #1] Cannot use Hires. fix #3

Open
opened 2026-10-30 21:02:58 +00:00 by bsakaguchi · 13 comments
Owner

Originally created by @mwbdcz on GitHub (Aug 2, 2023).
Original GitHub issue: https://github.com/ahgsql/StyleSelectorXL/issues/1

After enabling the StyleSelectorXL plugin, opening (Hires. fix) will report an error.It seems to be caused by not inputting prompt words.

*** Error completing request
*** Arguments: ('task(kdl6yijpo2wttb3)', '1girl, ', '', [], 20, 18, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 1024, 1024, True, 0.7, 1.1, 'Latent', 20, 0, 0, 0, '', '', [], <gradio.routes.Request object at 0x000001BD0092BAF0>, 0, True, '3D Model', False,

Change the process (self, p, is_enabled, style) in the program to process_ Batch (self, p, is_enabled, style, * * kwargs) can solve problems

Originally created by @mwbdcz on GitHub (Aug 2, 2023). Original GitHub issue: https://github.com/ahgsql/StyleSelectorXL/issues/1 After enabling the StyleSelectorXL plugin, opening (Hires. fix) will report an error.It seems to be caused by not inputting prompt words. *** Error completing request *** Arguments: ('task(kdl6yijpo2wttb3)', '1girl, ', '', [], 20, 18, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 1024, 1024, True, 0.7, 1.1, 'Latent', 20, 0, 0, 0, '', '', [], <gradio.routes.Request object at 0x000001BD0092BAF0>, 0, True, '3D Model', False, Change the process (self, p, is_enabled, style) in the program to process_ Batch (self, p, is_enabled, style, * * kwargs) can solve problems
Author
Owner

@ahgsql commented on GitHub (Aug 2, 2023):

Will check today and fix it soon

<!-- gh-comment-id:1662409694 --> @ahgsql commented on GitHub (Aug 2, 2023): Will check today and fix it soon
Author
Owner

@ahgsql commented on GitHub (Aug 5, 2023):

cant reproduce this issue, its working with Hires.Fix with no errors. Can you direct me to get your erros. In which stage or screen you saw that error

<!-- gh-comment-id:1666516221 --> @ahgsql commented on GitHub (Aug 5, 2023): cant reproduce this issue, its working with Hires.Fix with no errors. Can you direct me to get your erros. In which stage or screen you saw that error
Author
Owner

@blacklockshoot commented on GitHub (Aug 6, 2023):

i got same problem when i use styleselect with Hires. fix,

TypeError: must be real number, not NoneType

dreamshaperXL checkpoint,
hires step 0 and Denoising strength 0.45
size is 1024 x 1024

if i disable styleselect, all processing with no problem

<!-- gh-comment-id:1666869400 --> @blacklockshoot commented on GitHub (Aug 6, 2023): i got same problem when i use styleselect with Hires. fix, TypeError: must be real number, not NoneType dreamshaperXL checkpoint, hires step 0 and Denoising strength 0.45 size is 1024 x 1024 if i disable styleselect, all processing with no problem
Author
Owner

@Zibbibbo commented on GitHub (Aug 8, 2023):

I have the same problem

<!-- gh-comment-id:1670196728 --> @Zibbibbo commented on GitHub (Aug 8, 2023): I have the same problem
Author
Owner

@acezard commented on GitHub (Aug 9, 2023):

cant reproduce this issue, its working with Hires.Fix with no errors. Can you direct me to get your erros. In which stage or screen you saw that error

@ahgsql, please try following these steps in order to reproduce the error. On my end it is a 100% reproducible bug

When cycling through enabling and disabling the "hires fix" and "style selector" options, I encounter a TypeError: must be real number, not NoneType.

Steps to Reproduce:

  1. Initial Setup

    • Ensure "hires fix" is enabled.
    • Ensure "style selector" is enabled.
    • Result: Generation works without errors. (✅)
  2. Disabling Hires Fix

    • Disable "hires fix".
    • Ensure "style selector" is still enabled.
    • Result: Generation works without errors. (✅)
  3. Re-enabling Hires Fix

    • Enable "hires fix" again.
    • Result: Error encountered: TypeError: must be real number, not NoneType (❌)
  4. Disabling Either Option

    • Disable either "hires fix" OR "style selector".
    • Result: Generation works without errors. (✅)
  5. Re-enabling Disabled Option from Step 4

    • Enable the option you disabled in Step 4.
    • Result: Error encountered: TypeError: must be real number, not NoneType (❌)
<!-- gh-comment-id:1670750053 --> @acezard commented on GitHub (Aug 9, 2023): > cant reproduce this issue, its working with Hires.Fix with no errors. Can you direct me to get your erros. In which stage or screen you saw that error @ahgsql, please try following these steps in order to reproduce the error. On my end it is a 100% reproducible bug When cycling through enabling and disabling the "hires fix" and "style selector" options, I encounter a `TypeError: must be real number, not NoneType`. **Steps to Reproduce:** 1. **Initial Setup** - Ensure "hires fix" is enabled. - Ensure "style selector" is enabled. - Result: Generation works without errors. (✅) 2. **Disabling Hires Fix** - Disable "hires fix". - Ensure "style selector" is still enabled. - Result: Generation works without errors. (✅) 3. **Re-enabling Hires Fix** - Enable "hires fix" again. - Result: Error encountered: `TypeError: must be real number, not NoneType` (❌) 4. **Disabling Either Option** - Disable either "hires fix" OR "style selector". - Result: Generation works without errors. (✅) 5. **Re-enabling Disabled Option from Step 4** - Enable the option you disabled in Step 4. - Result: Error encountered: `TypeError: must be real number, not NoneType` (❌)
Author
Owner

@naql commented on GitHub (Aug 10, 2023):

I ran into this error when I first downloaded your extension, then it went away by itself. THen I updated, I see you have added a bunch of new styles and the error has come back. Here is the full stack trace:

```Traceback (most recent call last):
  File "D:\stable-diffusion-webui\modules\call_queue.py", line 58, in f
    res = list(func(*args, **kwargs))
  File "D:\stable-diffusion-webui\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "D:\stable-diffusion-webui\modules\txt2img.py", line 62, in txt2img
    processed = processing.process_images(p)
  File "D:\stable-diffusion-webui\modules\processing.py", line 677, in process_images
    res = process_images_inner(p)
  File "D:\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 "D:\stable-diffusion-webui\modules\processing.py", line 783, in process_images_inner
    p.setup_conds()
  File "D:\stable-diffusion-webui\modules\processing.py", line 1204, in setup_conds
    self.calculate_hr_conds()
  File "D:\stable-diffusion-webui\modules\processing.py", line 1187, in calculate_hr_conds
    self.hr_uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, self.hr_negative_prompts, self.steps * self.step_multiplier, [self.cached_hr_uc, self.cached_uc], self.hr_extra_network_data)
  File "D:\stable-diffusion-webui\modules\processing.py", line 353, in get_conds_with_caching
    cache[1] = function(shared.sd_model, required_prompts, steps)
  File "D:\stable-diffusion-webui\modules\prompt_parser.py", line 163, in get_learned_conditioning
    conds = model.get_learned_conditioning(texts)
  File "D:\stable-diffusion-webui\modules\sd_models_xl.py", line 24, in get_learned_conditioning
    "original_size_as_tuple": torch.tensor([height, width], **devices_args).repeat(len(batch), 1),
TypeError: must be real number, not NoneType```

For me, I do NOT get this error if it is "Base" selected, but any of the other styles do generate the error. I did not realize that "Hires-fix" was involved in this. I tried unchecking that and, sure enough, it did generate and use your style. As soon as I re-enable Hires-fix, it comes back and cannot generate until your styles are unselected.

<!-- gh-comment-id:1674020363 --> @naql commented on GitHub (Aug 10, 2023): I ran into this error when I first downloaded your extension, then it went away by itself. THen I updated, I see you have added a bunch of new styles and the error has come back. Here is the full stack trace: ```Traceback (most recent call last): File "D:\stable-diffusion-webui\modules\call_queue.py", line 58, in f res = list(func(*args, **kwargs)) File "D:\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(*args, **kwargs) File "D:\stable-diffusion-webui\modules\txt2img.py", line 62, in txt2img processed = processing.process_images(p) File "D:\stable-diffusion-webui\modules\processing.py", line 677, in process_images res = process_images_inner(p) File "D:\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 "D:\stable-diffusion-webui\modules\processing.py", line 783, in process_images_inner p.setup_conds() File "D:\stable-diffusion-webui\modules\processing.py", line 1204, in setup_conds self.calculate_hr_conds() File "D:\stable-diffusion-webui\modules\processing.py", line 1187, in calculate_hr_conds self.hr_uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, self.hr_negative_prompts, self.steps * self.step_multiplier, [self.cached_hr_uc, self.cached_uc], self.hr_extra_network_data) File "D:\stable-diffusion-webui\modules\processing.py", line 353, in get_conds_with_caching cache[1] = function(shared.sd_model, required_prompts, steps) File "D:\stable-diffusion-webui\modules\prompt_parser.py", line 163, in get_learned_conditioning conds = model.get_learned_conditioning(texts) File "D:\stable-diffusion-webui\modules\sd_models_xl.py", line 24, in get_learned_conditioning "original_size_as_tuple": torch.tensor([height, width], **devices_args).repeat(len(batch), 1), TypeError: must be real number, not NoneType``` For me, I do NOT get this error if it is "Base" selected, but any of the other styles do generate the error. I did not realize that "Hires-fix" was involved in this. I tried unchecking that and, sure enough, it did generate and use your style. As soon as I re-enable Hires-fix, it comes back and cannot generate until your styles are unselected.
Author
Owner

@wardensc2 commented on GitHub (Aug 13, 2023):

Please fix the issue with Hires Fix, I got the same bug as other people. I can only use Base Style without error.
I test with SD 1.5, your extension work well but not SD XL not sure what happen.

<!-- gh-comment-id:1676373231 --> @wardensc2 commented on GitHub (Aug 13, 2023): Please fix the issue with Hires Fix, I got the same bug as other people. I can only use Base Style without error. I test with SD 1.5, your extension work well but not SD XL not sure what happen.
Author
Owner

@mwbdcz commented on GitHub (Aug 15, 2023):

Roughly analyze process and process_ Batch is different. Process will only be called once during generation_ Batch is called before each generation. The reason for the error is not difficult to see from the stack trace that the prompt word after '3D Model' is missing, only this title. Hires.fix will be generated twice, but due to the fact that process is only called on the first generation and not called on the second, the prompt words before and after are inconsistent. So reported an error, I am not a professional. But change process() to process_ Batch() after , the problem was indeed resolved

<!-- gh-comment-id:1679285521 --> @mwbdcz commented on GitHub (Aug 15, 2023): Roughly analyze process and process_ Batch is different. Process will only be called once during generation_ Batch is called before each generation. The reason for the error is not difficult to see from the stack trace that the prompt word after '3D Model' is missing, only this title. Hires.fix will be generated twice, but due to the fact that process is only called on the first generation and not called on the second, the prompt words before and after are inconsistent. So reported an error, I am not a professional. But change process() to process_ Batch() after , the problem was indeed resolved
Author
Owner

@eniora commented on GitHub (Aug 18, 2023):

Same here when using Hires fix with SDXL 1.0
"TypeError: must be real number, not NoneType"

<!-- gh-comment-id:1683172040 --> @eniora commented on GitHub (Aug 18, 2023): Same here when using Hires fix with SDXL 1.0 "TypeError: must be real number, not NoneType"
Author
Owner

@wardensc2 commented on GitHub (Aug 18, 2023):

Roughly analyze process and process_ Batch is different. Process will only be called once during generation_ Batch is called before each generation. The reason for the error is not difficult to see from the stack trace that the prompt word after '3D Model' is missing, only this title. Hires.fix will be generated twice, but due to the fact that process is only called on the first generation and not called on the second, the prompt words before and after are inconsistent. So reported an error, I am not a professional. But change process() to process_ Batch() after , the problem was indeed resolved

Can you describe how to fix manually by editing some files ??

<!-- gh-comment-id:1683189049 --> @wardensc2 commented on GitHub (Aug 18, 2023): > Roughly analyze process and process_ Batch is different. Process will only be called once during generation_ Batch is called before each generation. The reason for the error is not difficult to see from the stack trace that the prompt word after '3D Model' is missing, only this title. Hires.fix will be generated twice, but due to the fact that process is only called on the first generation and not called on the second, the prompt words before and after are inconsistent. So reported an error, I am not a professional. But change process() to process_ Batch() after , the problem was indeed resolved Can you describe how to fix manually by editing some files ??
Author
Owner

@ahgsql commented on GitHub (Aug 18, 2023):

Tried all of steps, but just couldn't reproduce it. not sure why, no matter how many times i enable and disable hires, or change styles.

But it seems really annoying, And changing process to process_batch causing another errors thats needs to be fixed for general usage. Any one can fix, please create pull request. I am kinda busy these weeks

<!-- gh-comment-id:1684460721 --> @ahgsql commented on GitHub (Aug 18, 2023): Tried all of steps, but just couldn't reproduce it. not sure why, no matter how many times i enable and disable hires, or change styles. But it seems really annoying, And changing process to process_batch causing another errors thats needs to be fixed for general usage. Any one can fix, please create pull request. I am kinda busy these weeks
Author
Owner

@wardensc2 commented on GitHub (Aug 20, 2023):

Tried all of steps, but just couldn't reproduce it. not sure why, no matter how many times i enable and disable hires, or change styles.

But it seems really annoying, And changing process to process_batch causing another errors thats needs to be fixed for general usage. Any one can fix, please create pull request. I am kinda busy these weeks

Here is my screenshot when using hires fix

image

<!-- gh-comment-id:1685346100 --> @wardensc2 commented on GitHub (Aug 20, 2023): > Tried all of steps, but just couldn't reproduce it. not sure why, no matter how many times i enable and disable hires, or change styles. > > But it seems really annoying, And changing process to process_batch causing another errors thats needs to be fixed for general usage. Any one can fix, please create pull request. I am kinda busy these weeks Here is my screenshot when using hires fix ![image](https://github.com/ahgsql/StyleSelectorXL/assets/77379748/58b383d7-8dc4-4656-bd44-867f9bc60d67)
Author
Owner

@naql commented on GitHub (Sep 5, 2023):

with the latest, it's no longer blowing up, it's just not doing anything. uninstalling

<!-- gh-comment-id:1707288314 --> @naql commented on GitHub (Sep 5, 2023): with the latest, it's no longer blowing up, it's just not doing anything. uninstalling
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ahgsql/StyleSelectorXL#3
No description provided.