vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.51k stars 401 forks source link

[Issue]: "Enable second pass" always causes AttributeError #2558

Closed jbarlow83 closed 9 months ago

jbarlow83 commented 9 months ago

Issue Description

Whenever "Enable second pass" is checked, for any prompt and for any text to image settings , the following error always occurs:

AttributeError: 'StableDiffusionXLImg2ImgPipeline' object has no attribute 'sd_checkpoint_info'

It does not matter what prompt or settings are used for either base or refiner.

sd_xl_base_1.0 [31e5c...] sd_xl_refiner_1.0 [7440042bbd]

Version Platform Description

23:52:55-347866 INFO Starting SD.Next
23:52:55-349548 INFO Python 3.10.12 on Linux
23:52:55-357182 INFO Version: app=sd.next updated=2023-11-24 hash=a4a7a937 url=https://github.com/vladmandic/automatic/tree/master
23:52:55-735205 INFO Platform: arch=x86_64 cpu=x86_64 system=Linux release=6.5.6-76060506-generic python=3.10.12
23:52:55-736711 INFO nVidia CUDA toolkit detected: nvidia-smi present
23:52:55-737211 INFO Installing package: onnxruntime-gpu
23:53:10-687629 INFO Extensions: disabled=[]
23:53:10-688379 INFO Extensions: enabled=['Lora', 'clip-interrogator-ext', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg'] extensions-builtin
23:53:10-691421 INFO Extensions: enabled=[] extensions

Python package versions

Package                        Version
------------------------------ ------------------
absl-py                        2.0.0
accelerate                     0.24.1
addict                         2.4.0
aenum                          3.1.15
aiofiles                       23.2.1
aiohttp                        3.8.6
aiosignal                      1.3.1
altair                         5.1.2
annotated-types                0.6.0
antlr4-python3-runtime         4.9.3
anyio                          3.7.1
appdirs                        1.4.4
astunparse                     1.6.3
async-timeout                  4.0.3
attrs                          23.1.0
basicsr                        1.4.2
beautifulsoup4                 4.12.2
blendmodes                     2023
cachetools                     5.3.2
certifi                        2022.12.7
cffi                           1.16.0
charset-normalizer             2.1.1
clean-fid                      0.1.35
click                          8.1.7
clip                           1.0
clip-interrogator              0.6.0
cloudpickle                    3.0.0
colorama                       0.4.6
coloredlogs                    15.0.1
colorlog                       6.7.0
compel                         2.0.2
contourpy                      1.1.1
convcolors                     2.2.0
cssselect2                     0.7.0
cycler                         0.12.1
dctorch                        0.1.2
deprecation                    2.1.0
diffusers                      0.23.1
easydev                        0.12.1
einops                         0.4.1
exceptiongroup                 1.1.3
extcolors                      1.0.0
facexlib                       0.3.0
fastapi                        0.104.1
fasteners                      0.19
ffmpy                          0.3.1
filelock                       3.9.0
filetype                       1.2.0
filterpy                       1.4.5
flatbuffers                    23.5.26
fonttools                      4.43.1
frozenlist                     1.4.0
fsspec                         2023.10.0
ftfy                           6.1.1
future                         0.18.3
fvcore                         0.1.5.post20221221
gast                           0.4.0
gdown                          4.7.1
gfpgan                         1.3.8
gitdb                          4.0.11
GitPython                      3.1.40
google-auth                    2.23.4
google-auth-oauthlib           1.0.0
google-pasta                   0.2.0
gradio                         3.43.2
gradio_client                  0.5.0
greenlet                       3.0.1
grpcio                         1.59.2
h11                            0.14.0
h5py                           3.10.0
httpcore                       0.17.3
httpx                          0.24.1
huggingface-hub                0.19.4
humanfriendly                  10.0
idna                           3.4
imageio                        2.31.6
importlib-metadata             6.8.0
importlib-resources            6.1.0
inflection                     0.5.1
invisible-watermark            0.1.5
iopath                         0.1.9
Jinja2                         3.1.2
jsonmerge                      1.9.2
jsonschema                     4.19.2
jsonschema-specifications      2023.7.1
keras                          2.13.1
kiwisolver                     1.4.5
kornia                         0.7.0
lark                           1.1.8
lazy_loader                    0.3
libclang                       16.0.6
lightning-utilities            0.9.0
llvmlite                       0.40.1
lmdb                           1.4.1
lpips                          0.1.4
lxml                           4.9.3
Markdown                       3.5.1
markdown-it-py                 3.0.0
MarkupSafe                     2.1.2
matplotlib                     3.8.1
mdurl                          0.1.2
mediapipe                      0.10.7
mpmath                         1.3.0
multidict                      6.0.4
networkx                       3.0
numba                          0.57.1
numexpr                        2.8.4
numpy                          1.24.4
oauthlib                       3.2.2
omegaconf                      2.3.0
onnxruntime                    1.15.1
onnxruntime-gpu                1.16.3
open-clip-torch                2.23.0
opencv-contrib-python          4.8.1.78
opencv-contrib-python-headless 4.8.1.78
opencv-python                  4.8.1.78
opencv-python-headless         4.7.0.72
opt-einsum                     3.3.0
orjson                         3.9.10
packaging                      23.2
pandas                         1.5.3
pexpect                        4.8.0
pi-heif                        0.13.1
piexif                         1.1.3
Pillow                         10.1.0
pip                            22.0.2
platformdirs                   3.11.0
pooch                          1.8.0
portalocker                    2.8.2
protobuf                       3.20.3
psutil                         5.9.6
ptyprocess                     0.7.0
pyasn1                         0.5.0
pyasn1-modules                 0.3.0
pycparser                      2.21
pydantic                       1.10.13
pydantic_core                  2.10.1
pydub                          0.25.1
Pygments                       2.16.1
PyMatting                      1.1.10
pyparsing                      3.1.1
PySocks                        1.7.1
python-dateutil                2.8.2
python-multipart               0.0.6
pytorch-lightning              1.9.4
pytz                           2023.3.post1
PyWavelets                     1.4.1
PyYAML                         6.0.1
referencing                    0.30.2
regex                          2023.10.3
rembg                          2.0.52
reportlab                      4.0.6
requests                       2.31.0
requests-oauthlib              1.3.1
resize-right                   0.0.2
rich                           13.6.0
rpds-py                        0.10.6
rsa                            4.9
safetensors                    0.4.0
scikit-image                   0.22.0
scipy                          1.11.3
semantic-version               2.10.0
Send2Trash                     1.8.2
sentencepiece                  0.1.99
setuptools                     59.6.0
six                            1.16.0
smmap                          5.0.1
sniffio                        1.3.0
sounddevice                    0.4.6
soupsieve                      2.5
SQLAlchemy                     2.0.22
starlette                      0.27.0
svglib                         1.5.1
sympy                          1.12
tabulate                       0.9.0
tb-nightly                     2.16.0a20231101
tensorboard                    2.13.0
tensorboard-data-server        0.7.2
tensordict                     0.2.1
tensorflow                     2.13.0
tensorflow-estimator           2.13.0
tensorflow-io-gcs-filesystem   0.34.0
termcolor                      2.3.0
tifffile                       2023.9.26
timm                           0.9.7
tinycss2                       1.2.1
tokenizers                     0.15.0
tomesd                         0.1.3
toml                           0.10.2
tomli                          2.0.1
toolz                          0.12.0
torch                          2.1.0+cu121
torchdiffeq                    0.2.3
torchmetrics                   1.2.0
torchsde                       0.2.6
torchvision                    0.16.0+cu121
tqdm                           4.66.1
trampoline                     0.1.2
transformers                   4.35.2
triton                         2.1.0
typing_extensions              4.8.0
tzdata                         2023.3
urllib3                        1.26.15
uvicorn                        0.23.2
voluptuous                     0.13.1
wcwidth                        0.2.9
webencodings                   0.5.1
websockets                     11.0.3
Werkzeug                       3.0.1
wheel                          0.41.3
wrapt                          1.15.0
yacs                           0.1.8
yapf                           0.40.2
yarl                           1.9.2
zipp                           3.17.0

Relevant log output

AttributeError: 'StableDiffusionXLImg2ImgPipeline' object has no attribute 'sd_checkpoint_info'
Progress 10.45it/s █████████████████                  52% 16/31 00:01 00:01 Base
01:10:46-828742 INFO     Hires: upscaler=Lanczos width=1024 height=1536 images=1                                                                                                      
Progress  2.51it/s █████████████████▊                56% 5/9 00:01 00:01 Refiner
01:10:53-714852 INFO     GPU high memory utilization: 90% {'ram': {'used': 45.12, 'total': 61.95}, 'gpu': {'used': 21.3, 'total': 23.62}, 'retries': 0, 'oom': 0}                     
01:10:56-215838 ERROR    Exception: 'StableDiffusionXLImg2ImgPipeline' object has no attribute 'sd_checkpoint_info'                                                                   
01:10:56-216573 ERROR    Arguments: args=('task(wzk6qufzubp2beq)', 'a tree', '', [], 20, 11, 11, True, False, False, 1, 1, 5.8, 6, 0.7, 1, -1.0, -1.0, 0, 0, 0, 768, 512, True, 0.5,  
                         2, 'Lanczos', False, 20, 0, 0, 5, 0.8, 'photo', '', [], 0, False, False, 'positive', 'comma', 0, False, False, '', 0, '', [], 0, '', [], 0, '', [], False,   
                         True, False, False, False, False, 0) kwargs={}                                                                                                               
01:10:56-217828 ERROR    gradio call: AttributeError                                                                                                                                  
╭──────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────╮
│ /home/jb/src/stable-diffusion-next/modules/call_queue.py:34 in f                                                                                                                   │
│                                                                                                                                                                                    │
│   33 │   │   │   try:                                                                                                                                                              │
│ ❱ 34 │   │   │   │   res = func(*args, **kwargs)                                                                                                                                   │
│   35 │   │   │   │   progress.record_results(id_task, res)                                                                                                                         │
│                                                                                                                                                                                    │
│ /home/jb/src/stable-diffusion-next/modules/txt2img.py:66 in txt2img                                                                                                                │
│                                                                                                                                                                                    │
│   65 │   if processed is None:                                                                                                                                                     │
│ ❱ 66 │   │   processed = processing.process_images(p)                                                                                                                              │
│   67 │   p.close()                                                                                                                                                                 │
│                                                                                                                                                                                    │
│ /home/jb/src/stable-diffusion-next/modules/processing.py:739 in process_images                                                                                                     │
│                                                                                                                                                                                    │
│    738 │   │   │   with context_hypertile_vae(p), context_hypertile_unet(p):                                                                                                       │
│ ❱  739 │   │   │   │   res = process_images_inner(p)                                                                                                                               │
│    740 │   finally:                                                                                                                                                                │
│                                                                                                                                                                                    │
│ /home/jb/src/stable-diffusion-next/modules/processing.py:943 in process_images_inner                                                                                               │
│                                                                                                                                                                                    │
│    942 │   │   │   │   image = apply_overlay(image, p.paste_to, i, p.overlay_images)                                                                                               │
│ ❱  943 │   │   │   │   text = infotext(i)                                                                                                                                          │
│    944 │   │   │   │   infotexts.append(text)                                                                                                                                      │
│                                                                                                                                                                                    │
│ /home/jb/src/stable-diffusion-next/modules/processing.py:908 in infotext                                                                                                           │
│                                                                                                                                                                                    │
│    907 │   │   │   def infotext(index): # pylint: disable=function-redefined # noqa: F811                                                                                          │
│ ❱  908 │   │   │   │   return create_infotext(p, p.prompts, p.seeds, p.subseeds, index=index, a                                                                                    │
│    909                                                                                                                                                                             │
│                                                                                                                                                                                    │
│ /home/jb/src/stable-diffusion-next/modules/processing.py:589 in create_infotext                                                                                                    │
│                                                                                                                                                                                    │
│    588 │   │   args["Second pass"] = p.enable_hr                                                                                                                                   │
│ ❱  589 │   │   args["Refiner"] = None if (not shared.opts.add_model_name_to_info) or (not share                                                                                    │
│    590 │   │   args['Image CFG scale'] = p.image_cfg_scale                                                                                                                         │
│                                                                                                                                                                                    │
│ /home/jb/src/stable-diffusion-next/venv/lib/python3.10/site-packages/diffusers/configuration_utils.py:137 in __getattr__                                                           │
│                                                                                                                                                                                    │
│   136 │   │                                                                                                                                                                        │
│ ❱ 137 │   │   raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'"                                                                                     │
│   138                                                                                                                                                                              │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'StableDiffusionXLImg2ImgPipeline' object has no attribute 'sd_checkpoint_info'

Backend

Diffusers

Branch

Master

Model

SD-XL

Acknowledgements

vladmandic commented 9 months ago

fixed in dev, will be merged to master in the next release.