deforum-art / sd-webui-deforum

Deforum extension for AUTOMATIC1111's Stable Diffusion webui
https://deforum.github.io
Other
2.65k stars 387 forks source link

[Bug]: 'bad sampler name: DPM++ 2M SDE Karras' #967

Closed rhyswynn closed 3 months ago

rhyswynn commented 4 months ago

Have you read the latest version of the FAQ?

Is there an existing issue for this?

Are you using the latest version of the Deforum extension?

What happened?

Installed Automatic1111 new yesterday. Selecting samplers with 'karas' extension and trying to generate gives an error Error: 'bad sampler name: DPM++ 2M SDE Karras'.

Steps to reproduce the problem

  1. Select DPM++ 2M SDE Karras sampler
  2. Click Generate

What should have happened/how would you fix it?

I expect generation to begin and complete. Looking at the new A1111 architecture, txt2img has separate drop downs for sampler and scheduler. sd_sample.py includes all of the different sampler/scheduler combinations in the older version, the new version has separate sd_sample.py and sd_schedule.py for combining the selections, which doesn't work with the current version of Deforum.

Torch version

2.1.2+cu121

On which platform are you launching the webui with the extension?

No response

Deforum settings

Default settings on a new install and newly loaded UI

Webui core settings

https://1drv.ms/f/s!AsWJ6d6qrrw5gpxSHNtP1KgU1yzQSA?e=NS2PkP

Console logs

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on rhys user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.35
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
Python 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0]
Version: v1.9.0
Commit hash: adadb4e3c7382bf3e4f7519126cd6c70f4f8557b
Launching Web UI with arguments: --lora-dir /media/rhys/Data/AiWotBotxfer/models/loras --vae-dir /media/rhys/Data/AiWotBotxfer/models/vae --ckpt-dir /media/rhys/Data/AiWotBotxfer/models/checkpoints --xformers --precision full --no-half --always-batch-cond-uncond --opt-split-attention
ControlNet preprocessor location: /media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2024-04-17 17:17:35,707 - ControlNet - INFO - ControlNet v1.1.443
2024-04-17 17:17:35,759 - ControlNet - INFO - ControlNet v1.1.443
Loading weights [e848cb9919] from /media/rhys/Data/AiWotBotxfer/models/checkpoints/SDXL/brightprotonukeBPNNo_bpn13.safetensors
2024-04-17 17:17:35,963 - ControlNet - INFO - ControlNet UI callback registered.
Creating model from config: /media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/repositories/generative-models/configs/inference/sd_xl_base.yaml
*Deforum ControlNet support: enabled*
Loading general settings...
reading custom settings from /media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/deforum_settings.txt
The custom settings file does not exist. The values will be unchanged.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 7.1s (prepare environment: 1.2s, import torch: 2.4s, import gradio: 0.3s, setup paths: 1.0s, other imports: 0.4s, list SD models: 0.2s, load scripts: 0.7s, create ui: 0.5s, gradio launch: 0.3s).
Applying attention optimization: xformers... done.
Model loaded in 3.2s (load weights from disk: 0.3s, create model: 0.6s, apply weights to model: 1.9s, load textual inversion embeddings: 0.2s).
Restarting UI...
Closing server running on port: 7860
2024-04-17 17:24:54,913 - ControlNet - INFO - ControlNet v1.1.443
2024-04-17 17:24:55,033 - ControlNet - INFO - ControlNet UI callback registered.
Loading general settings...
reading custom settings from /media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/deforum_settings.txt
The custom settings file does not exist. The values will be unchanged.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 0.6s (load scripts: 0.2s, create ui: 0.3s).
reading custom settings from /media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/settings2keep/horoscopenew.txt
started run_deforum
times_to_run: 1
Deforum extension for auto1111 webui
Git commit: 32242685
Starting job task(1jt59zl7a5n0yrz)-0...
Saving animation frames to:
/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/outputs/img2img-images/Deforum_NewRun
Loading MiDaS model from dpt_large-midas-2f21e586.pt...
Animation frame: 0/905  
Seed: 2284222973
Prompt: <lora:add_detail:1> chaotic glitch details, hyper psychedelic organic details, explosive fractal splash details,  January rendered in a glitch style, with icy landscapes transforming into jagged digital shards, portraying the cold snap of winter through a fusion of natural and pixelated chaos. <lora:GlitchGirlModel1Final-xl:.34><lora:liquid_Fluid_Metal_XL_-_By_DICE:.41><lora:crystalz-sdxl:.3>
Neg Prompt: out of frame, lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, duplicate, wrong proportions, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature, easynegative, bad-hands-5, [negativebs:0.2], (low quality, worst quality:1.3), backlit, bad-picture-chill-75v, watermark, letters, words, censored, multiple fingers, multiple legs, bad hands, blur, pixelated, bad anatomy:1.2, cropped hands, artist name, extra digit, fewer digit, author name, names, autograph, hand writing, written text, five legs, five legs, 3 legs, three legs, five legs, 5 legs, bad hands, bad legs, bad body shape, multiple tails, two tails, deformated body, imperfect painting, blurry hands, blurry face, blurry body, blurry image, nipple,  breast, nude, nsfw, text, words, letters, writing
Not using an init image (doing pure txt2img)
╭─────┬───┬───────┬────┬────┬────┬────┬────┬────╮
│Steps│CFG│Denoise│Tr X│Tr Y│Tr Z│Ro X│Ro Y│Ro Z│
├─────┼───┼───────┼────┼────┼────┼────┼────┼────┤
│ 30  │8.5│   0   │0.5 │0.5 │ 5  │ 0  │ 0  │ 0  │
╰─────┴───┴───────┴────┴────┴────┴────┴────┴────╯
WARNING:deforum_helpers.opts_overrider:Error during batch execution: <class 'AssertionError'> - bad sampler name: DPM++ 2M SDE Karras

*START OF TRACEBACK*
Traceback (most recent call last):
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_helpers/run_deforum.py", line 116, in run_deforum
    render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root)
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_helpers/render.py", line 577, in render_animation
    image = generate(args, keys, anim_args, loop_args, controlnet_args, root, parseq_adapter, frame_idx, sampler_name=scheduled_sampler_name)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_helpers/generate.py", line 78, in generate
    return generate_inner(args, keys, anim_args, loop_args, controlnet_args, root, parseq_adapter, frame, sampler_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts/deforum_helpers/generate.py", line 241, in generate_inner
    processed = processing.process_images(p_txt)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/modules/processing.py", line 845, in process_images
    res = process_images_inner(p)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 59, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/modules/processing.py", line 981, in process_images_inner
    samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/modules/processing.py", line 1299, in sample
    self.sampler = sd_samplers.create_sampler(self.sampler_name, self.sd_model)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/rhys/Data/AiWotBotxfer/stable-diffusion-webui/stable-diffusion-webui/modules/sd_samplers.py", line 36, in create_sampler
    assert config is not None, f'bad sampler name: {name}'
           ^^^^^^^^^^^^^^^^^^
AssertionError: bad sampler name: DPM++ 2M SDE Karras
*END OF TRACEBACK*

User friendly error message:
Error: bad sampler name: DPM++ 2M SDE Karras. Please, check your schedules/ init values.

Additional information

No response

rhyswynn commented 4 months ago

I was able to get this to work by adding a Scheduler control and updating these 5 files: args.py, defaults.py, generate.py, ui_elements.py, and webui_sd_pipeline.py. The underlying breaking change is that the StableDiffusionProcessingImg2Img in modules.processing has been updated to include a separate scheduler property.

steak3 commented 4 months ago

Same here with "DPM++ 2M Karras" since last A1111 version 1.9. Sampler and scheduler are now separated

This seems a blocking issue. Would love to see a bypass in the meantime

steak3 commented 4 months ago

I was able to get this to work by adding a Scheduler control and updating these 5 files: args.py, defaults.py, generate.py, ui_elements.py, and webui_sd_pipeline.py. The underlying breaking change is that the StableDiffusionProcessingImg2Img in modules.processing has been updated to include a separate scheduler property.

Any chance to get these files ?

rhyswynn commented 4 months ago

https://github.com/deforum-art/sd-webui-deforum/pull/968 submitted from my fork at https://github.com/rhyswynn/sd-webui-deforum. The updated files are located under scripts/deforum_helpers args.py defaults.py generate.py settings.py ui_elements.py webui_sd_pipeline.py

steak3 commented 4 months ago

968 submitted from my fork at https://github.com/rhyswynn/sd-webui-deforum. The updated files are located under scripts/deforum_helpers args.py defaults.py generate.py settings.py ui_elements.py webui_sd_pipeline.py

Works like a charm, thanks. I hope it will be merged 😊

rewbs commented 3 months ago

This is now merged. Thanks @rhyswynn !