Panchovix / stable-diffusion-webui-reForge

GNU Affero General Public License v3.0
287 stars 10 forks source link

[Bug]: 'ldm_patched.modules.model_management' has no attribute 'VAE_ALWAYS_TILED' Traceback (most recent call last): #88

Closed MNeMoNiCuZ closed 1 month ago

MNeMoNiCuZ commented 1 month ago

Checklist

What happened?

Trying to use my extension Thumbnailizer, I'm not able to do so with ReForge (or Forge perhaps).

It works fine in A1111 still, and it used to work in Forge.

Errors from log is below. I have no idea =/

Steps to reproduce the problem

  1. Install the Thumbnailizer extension
  2. Try to generate thumbnails with it

What should have happened?

Not give the error messages below

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

Nah

Console logs

Loading model Checkpoints\Checkpoints\SDXL\Unsorted\thinkdiffusionxl_v10.safetensors (2 out of 10)
Calculating sha256 for C:\AI\stable-diffusion-webui-reForge\models\Stable-diffusion\Checkpoints\Checkpoints\SDXL\Unsorted\thinkdiffusionxl_v10.safetensors: a21c9949efcb8a0218f575aaff3fd5e8fedc508ca6757ddb44c5958cb0859f77
Loading weights [a21c9949ef] from C:\AI\stable-diffusion-webui-reForge\models\Stable-diffusion\Checkpoints\Checkpoints\SDXL\Unsorted\thinkdiffusionxl_v10.safetensors
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}
Loading VAE weights specified in settings: C:\AI\stable-diffusion-webui-reForge\models\VAE\SDXL\sdxl_vae.safetensors
To load target model SDXLClipModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) =  21319.0791015625
[Memory Management] Model Memory (MB) =  2144.3546981811523
[Memory Management] Minimal Inference Memory (MB) =  1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) =  18150.724403381348
Moving model(s) has taken 0.46 seconds
Model loaded in 8.1s (calculate hash: 4.5s, load weights from disk: 0.1s, forge load real models: 2.8s, load VAE: 0.1s, calculate empty prompt: 0.5s).
WARNING:root:Sampler Scheduler autocorrection: "Euler a" -> "Euler a", "None" -> "Automatic"
To load target model SDXL
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) =  19530.47119140625
[Memory Management] Model Memory (MB) =  4897.086494445801
[Memory Management] Minimal Inference Memory (MB) =  1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) =  13609.38469696045
Moving model(s) has taken 1.05 seconds
100%|██████████████████████████████████████████████████████████████████████████████| 25/25 [00:07<00:00,  3.45it/s]
Error in generating thumbnail for thinkdiffusionxl_v10: module 'ldm_patched.modules.model_management' has no attribute 'VAE_ALWAYS_TILED'
Traceback (most recent call last):
  File "C:\AI\stable-diffusion-webui-reForge\extensions\sd-webui-thumbnailizer\scripts\thumbnailizer.py", line 309, in generate_thumbnail_for_model
    processed = processing.process_images(p)
  File "C:\AI\stable-diffusion-webui-reForge\modules\processing.py", line 815, in process_images
    res = process_images_inner(p)
  File "C:\AI\stable-diffusion-webui-reForge\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 "C:\AI\stable-diffusion-webui-reForge\modules\processing.py", line 643, in decode_latent_batch
    samples_pytorch = decode_first_stage(model, batch).to(target_device)
  File "C:\AI\stable-diffusion-webui-reForge\modules\sd_samplers_common.py", line 74, in decode_first_stage
    return samples_to_images_tensor(x, approx_index, model)
  File "C:\AI\stable-diffusion-webui-reForge\modules\sd_samplers_common.py", line 57, in samples_to_images_tensor
    x_sample = model.decode_first_stage(sample)
  File "C:\AI\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\AI\stable-diffusion-webui-reForge\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 "C:\AI\stable-diffusion-webui-reForge\ldm_patched\modules\sd.py", line 288, in decode
    return self.decode_inner(samples_in)
  File "C:\AI\stable-diffusion-webui-reForge\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'

Additional information

No response

Panchovix commented 1 month ago

Hi there, thanks for the report. The issue is pretty weird, since I should have fixed it like a week ago https://github.com/Panchovix/stable-diffusion-webui-reForge/issues/42

Are you on latest commit? I just tested your extensions it works fine (pretty nice extension!)

Thumbnail generated and saved as G:\Stable difussion\stable-diffusion-webui-reForge\models\Stable-diffusion\33\b64_a2v_creamypesto_AMBW_anime25like2.png
Processed 1/2 thumbnails
Generating 'Default' thumbnail for model: b64_a2v_creamypesto_AMBW_aokoPVCv2.safetensors

Thumbnailizer: Not using override settings for model: b64_a2v_creamypesto_AMBW_aokoPVCv2.safetensors
Generating thumbnail for model: b64_a2v_creamypesto_AMBW_aokoPVCv2.safetensors at path: G:\Stable difussion\stable-diffusion-webui-reForge\models\Stable-diffusion\33\b64_a2v_creamypesto_AMBW_aokoPVCv2.safetensors with output: G:\Stable difussion\stable-diffusion-webui-reForge\models\Stable-diffusion\33\b64_a2v_creamypesto_AMBW_aokoPVCv2
 ------------ Unloading oldest model: 33\b64_a2v_creamypesto_AMBW_anime25like2.safetensors [1186da7102]... -------------
Loading model 33\b64_a2v_creamypesto_AMBW_aokoPVCv2.safetensors [54b40650ff] (1 out of 1)
Loading weights [54b40650ff] from G:\Stable difussion\stable-diffusion-webui-reForge\models\Stable-diffusion\33\b64_a2v_creamypesto_AMBW_aokoPVCv2.safetensors
model_type EPS
UNet ADM Dimension 0
Using xformers attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using xformers attention in VAE
extra {'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale'}
left over keys: dict_keys(['model_ema.decay', 'model_ema.num_updates'])
loaded straight to GPU
To load target model BaseModel
Begin to load 1 model
Moving model(s) has taken 0.01 seconds
Loading VAE weights specified in settings: G:\Stable difussion\stable-diffusion-webui-reForge\models\VAE\sdxl_vae_fixedfp16.safetensors
To load target model SD1ClipModel
Begin to load 1 model
Moving model(s) has taken 0.05 seconds
Model loaded in 2.8s (unload oldest model if necessary: 1.0s, forge load real models: 0.9s, load textual inversion embeddings: 0.7s).
WARNING:root:Sampler Scheduler autocorrection: "Euler a" -> "Euler a", "None" -> "Automatic"
To load target model BaseModel
Begin to load 1 model
Moving model(s) has taken 0.01 seconds
100%|█████████████████████████████████████████████████████████████████████████████████| 25/25 [00:01<00:00, 23.36it/s]
To load target model AutoencoderKLit/s]
Begin to load 1 model
Moving model(s) has taken 0.03 seconds

Thumbnail generated and saved as G:\Stable difussion\stable-diffusion-webui-reForge\models\Stable-diffusion\33\b64_a2v_creamypesto_AMBW_aokoPVCv2.png
Processed 2/2 thumbnails

Thumbnailizer - Finished processing 2 thumbnails
Thumbnailizer: Switched to set: Default ()
Thumbnailizer: Found 162 relevant thumbnails
MNeMoNiCuZ commented 1 month ago

It appears you are right! I hadn't updated in the last week it appears.

It works just fine now! Thanks for confirming, and for the kind works on the extension <3