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

[BUG] sonar is broken :( #1

Closed
Rogal80 opened this issue Jan 2, 2023 · 7 comments
Closed

[BUG] sonar is broken :( #1

Rogal80 opened this issue Jan 2, 2023 · 7 comments

Comments

@Rogal80
Copy link

Rogal80 commented Jan 2, 2023

Hi, awesome script :) but it stopped working after las commit from Auto , I have this issue

Traceback (most recent call last):
File "I:\Github\stable-diffusion-webui\modules\call_queue.py", line 45, in f
res = list(func(*args, **kwargs))
File "I:\Github\stable-diffusion-webui\modules\call_queue.py", line 28, in f
res = func(*args, **kwargs)
File "I:\Github\stable-diffusion-webui\modules\txt2img.py", line 46, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "I:\Github\stable-diffusion-webui\modules\scripts.py", line 328, in run
processed = script.run(p, *script_args)
File "I:\Github\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 951, in run
proc = process_images(p)
File "I:\Github\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 78, in process_images
res = process_images_inner(p)
File "I:\Github\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 180, in process_images_inner
samples_ddim = sample_func(p, conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
File "I:\Github\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 271, in StableDiffusionProcessingTxt2Img_sample
x = create_random_tensors([opt_C, self.firstphase_height // opt_f, self.firstphase_width // opt_f], seeds=seeds, subseeds=subseeds, subseed_strength=self.subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w, p=self)
AttributeError: 'StableDiffusionProcessingTxt2Img' object has no attribute 'firstphase_height'

Please can you fix this ?

Kahsolt added a commit that referenced this issue Jan 3, 2023
@Kahsolt
Copy link
Owner

Kahsolt commented Jan 3, 2023

Thanks for informing~ Now it should be fixed~ 😃

@Rogal80
Copy link
Author

Rogal80 commented Jan 3, 2023

Hi, thanks for fix but still probably we will need to have another fix :( , right now, there is a big discussion about new highres fix, everybody are confused : AUTOMATIC1111/stable-diffusion-webui#6219

@Kahsolt
Copy link
Owner

Kahsolt commented Jan 4, 2023

Wow, it's really a long and interesting discussion. 😃
Since I rarely used hires.fix before, I'm looking into and testing it to get some understanding right now.

Kahsolt added a commit that referenced this issue Jan 4, 2023
@Kahsolt
Copy link
Owner

Kahsolt commented Jan 4, 2023

Oh bad news, sonar grad is henceforth dead.
I updated readme for explaination, in short, this commit AUTOMATIC1111/stable-diffusion-webui@bd68e35 breaks gradient calculation. Currently there is no work around.

@Rogal80
Copy link
Author

Rogal80 commented Jan 4, 2023

yea, I notice another issue but its only appear with latent upscalers :

Traceback (most recent call last):
File "I:\Github\new_webui\stable-diffusion-webui\modules\call_queue.py", line 45, in f
res = list(func(*args, **kwargs))
File "I:\Github\new_webui\stable-diffusion-webui\modules\call_queue.py", line 28, in f
res = func(*args, **kwargs)
File "I:\Github\new_webui\stable-diffusion-webui\modules\txt2img.py", line 46, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "I:\Github\new_webui\stable-diffusion-webui\modules\scripts.py", line 328, in run
processed = script.run(p, *script_args)
File "I:\Github\new_webui\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 963, in run
proc = process_images(p)
File "I:\Github\new_webui\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 80, in process_images
res = process_images_inner(p)
File "I:\Github\new_webui\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 187, in process_images_inner
samples_ddim = sample_func(p, conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
File "I:\Github\new_webui\stable-diffusion-webui\extensions\stable-diffusion-webui-sonar\scripts\sonar.py", line 300, in StableDiffusionProcessingTxt2Img_sample
samples = torch.nn.functional.interpolate(samples, size=(target_height // opt_f, target_width // opt_f), mode=latent_scale_mode)
File "I:\Github\new_webui\stable-diffusion-webui\venv\lib\site-packages\torch\nn\functional.py", line 3961, in interpolate
raise NotImplementedError(
NotImplementedError: Input Error: Only 3D, 4D and 5D input Tensors supported (got 4D) for the modes: nearest | linear | bilinear | bicubic | trilinear | area | nearest-exact (got {'mode': 'bilinear', 'antialias': False})

@Kahsolt
Copy link
Owner

Kahsolt commented Jan 5, 2023

Not sonar's fault, this is due to a code conflict by maybe two commiters working on hires.fix Upscaler option.
In the latest commit, this code line in modules/processing.py:

samples = torch.nn.functional.interpolate(samples, size=(target_height // opt_f, target_width // opt_f), mode=latent_scale_mode)

has been changed to

samples = torch.nn.functional.interpolate(samples, size=(target_height // opt_f, target_width // opt_f), mode=latent_scale_mode["mode"], antialias=latent_scale_mode["antialias"])

which fixed this bug.

@Rogal80
Copy link
Author

Rogal80 commented Jan 7, 2023

thx :)

@Rogal80 Rogal80 closed this as completed Jan 7, 2023
Kahsolt added a commit that referenced this issue Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants