Panchovix / stable-diffusion-webui-reForge

GNU Affero General Public License v3.0
351 stars 17 forks source link

[Bug]: VAE_ALWAYS_TILED is not defined by default. #42

Closed exdownloader closed 3 months ago

exdownloader commented 3 months ago

Checklist

What happened?

VAE_ALWAYS_TILED, defined in ldm_patched/modules/model_management.py in Forge regular, prevents gens from falling over with (log in another report field).

It seems like this declaration was removed. It was coincidentally reintroduced in sd_forge_neveroom, when enabled, resolves the issue. Perhaps the default declaration should be restored.

Steps to reproduce the problem

Disable NeverOOM extension, generate in txt2img

What should have happened?

No error due to missing field, a regular txt2img gen.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2024-07-21-01-14.json

Console logs

File "X:\SD\forge\modules_forge\main_thread.py", line 37, in loop
    task.work()
  File "X:\SD\forge\modules_forge\main_thread.py", line 26, in work
    self.result = self.func(*self.args, **self.kwargs)
  File "X:\SD\forge\modules\txt2img.py", line 110, in txt2img_function
    processed = processing.process_images(p)
  File "X:\SD\forge\modules\processing.py", line 815, in process_images
    res = process_images_inner(p)
  File "X:\SD\forge\modules\processing.py", line 1005, in process_images_inner
    x_samples_ddim = decode_latent_batch(p.sd_model, samples_ddim, target_device=devices.cpu, check_for_nans=True)
  File "X:\SD\forge\modules\processing.py", line 643, in decode_latent_batch
    samples_pytorch = decode_first_stage(model, batch).to(target_device)
  File "X:\SD\forge\modules\sd_samplers_common.py", line 74, in decode_first_stage
    return samples_to_images_tensor(x, approx_index, model)
  File "X:\SD\forge\modules\sd_samplers_common.py", line 57, in samples_to_images_tensor
    x_sample = model.decode_first_stage(sample)
  File "X:\SD\forge\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "X:\SD\forge\modules_forge\forge_loader.py", line 239, in patched_decode_first_stage
    sample = sd_model.forge_objects.vae.decode(sample).movedim(-1, 1) * 2.0 - 1.0
  File "X:\SD\forge\ldm_patched\modules\sd.py", line 288, in decode
    return self.decode_inner(samples_in)
  File "X:\SD\forge\ldm_patched\modules\sd.py", line 264, in decode_inner
    if model_management.VAE_ALWAYS_TILED:
AttributeError: module 'ldm_patched.modules.model_management' has no attribute 'VAE_ALWAYS_TILED'
module 'ldm_patched.modules.model_management' has no attribute 'VAE_ALWAYS_TILED'
*** Error completing request

Additional information

No response

Panchovix commented 3 months ago

Hi there, thanks for the report. You're totally correct.

Pushed a commit for both main and dev_upstream that should fix this issue.

exdownloader commented 3 months ago

That's the issue resolved on my end, nice one!