Kahsolt / stable-diffusion-webui-prompt-travel

Travel between prompts in the latent space to make pseudo-animation, extension script for AUTOMATIC1111/stable-diffusion-webui.
The Unlicense
248 stars 22 forks source link

"Error loading script: prompt_travel.py" after updating A1111's webui to latest commits #14

Closed illtellyoulater closed 1 year ago

illtellyoulater commented 1 year ago

Getting this on windows 10 after git pulling latest commits:

Error loading script: prompt_travel.py
Traceback (most recent call last):
  File "C:\Users\username\desktop\stable-diffusion-webui\modules\scripts.py", line 229, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "C:\Users\username\desktop\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\username\desktop\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 26, in <module>
    from modules.sd_samplers import single_sample_to_image
ImportError: cannot import name 'single_sample_to_image' from 'modules.sd_samplers' (C:\Users\username\desktop\stable-diffusion-webui\modules\sd_samplers.py)

This is due to WebUI updated to reorganize sampler code recently. It goes away by doing: git checkout cbd6329488beafe036ea3a3d0cea1a6940105cf9 (the last commit before sampler reorg).

How this was fixed in another extension: https://github.com/mcmonkeyprojects/sd-dynamic-thresholding/issues/2

giga-bytes-dev commented 1 year ago

Commit with fixes in sd-dynamic-thresholding https://github.com/mcmonkeyprojects/sd-dynamic-thresholding/commit/b5a79834541baf2f082541dc03fdce110621faa3

-- from modules import sd_samplers, scripts ++ from modules import scripts, sd_samplers, sd_samplers_kdiffusion, sd_samplers_common

-- newSampler = sd_samplers.SamplerData(fixed_sampler_name, newConstructor, sampler.aliases, sampler.options) ++ newSampler = sd_samplers_common.SamplerData(fixed_sampler_name, newConstructor, sampler.aliases, sampler.options)

illtellyoulater commented 1 year ago

I opened an issue for this on webui repo (https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7402) and was advised to change line 26 of stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py like this:

# from modules.sd_samplers import single_sample_to_image
from modules.sd_samplers_common import single_sample_to_image

I made the change and the extension now loads and shows up correctly in the UI. Then I tried using it and it also seems to work properly.