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

Using grad mode in automatic 1111 leads to a torch error #7

Closed PGadoury closed 1 year ago

PGadoury commented 1 year ago

Here's the callback. I tried removing all command line arguments from webui-user.bat, so I don't think it's one of those...

Traceback (most recent call last): File "D:\stable-diffusion-webui\modules\call_queue.py", line 45, in f res = list(func(*args, **kwargs)) File "D:\stable-diffusion-webui\modules\call_queue.py", line 28, in f res = func(*args, **kwargs) File "D:\stable-diffusion-webui\modules\txt2img.py", line 46, in txt2img processed = modules.scripts.scripts_txt2img.run(p, *args) File "D:\stable-diffusion-webui\modules\scripts.py", line 328, in run processed = script.run(p, *script_args) File "D:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 685, in run elif mode == 'grad' : images, info = self.run_grad() File "D:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 1044, in run_grad grad_latent = torch.autograd.grad(loss_latent, current_cond, grad_outputs=loss_latent)[0] # [B=1, T=77, D=768] File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\autograd\__init__.py", line 276, in grad return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\autograd\function.py", line 253, in apply return user_fn(self, *args) File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 102, in backward raise RuntimeError( RuntimeError: Checkpointing is not compatible with .grad() or when aninputsparameter is passed to .backward(). Please use .backward() and do not pass itsinputsargument.

Kahsolt commented 1 year ago

Ahh, the latest commit of webui changes some memory management behaviour and seems to break something... 🤔 I'll be back soon to check whether it's possible to fix. Currently working on some hires.fix issues (

PGadoury commented 1 year ago

Thanks for checking! Fantastic extension, by the way :)

On Wed, Jan 4, 2023 at 1:35 AM Kahsolt @.***> wrote:

Ahh, the latest commit of webui changes some memory management behaviour and seems to break something... 🤔 I'll be back soon to check whether it's possible to fix. Currently working on some hires.fix issues (

— Reply to this email directly, view it on GitHub https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel/issues/7#issuecomment-1370536679, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA7AY77VDJPT6USP3ARGSLWQUK3LANCNFSM6AAAAAATQNDCJE . You are receiving this because you authored the thread.Message ID: @.*** com>

Kahsolt commented 1 year ago

Bad news bro, prompt-travel grad mode is henceforth dead. I've updated readme for more explanation. Words in short, this commit https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/bd68e35de3b7cf7547ed97d8bdf60147402133cc breaks gradient calculation. Currently there is no work around.

Still, replace & grad mode are quite quite experimental and usually do not produce good results in my experience... Just have fun with the simplest linear mode ;)

PGadoury commented 1 year ago

Thanks for looking into it :)

On Wed, Jan 4, 2023 at 9:33 AM Kahsolt @.***> wrote:

Bad news bro, prompt-travel grad mode is henceforth dead. I've updated readme for more explanation. Words in short, this commit @.*** https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/bd68e35de3b7cf7547ed97d8bdf60147402133cc breaks gradient calculation. Currently there is no work around.

Still, replace & grad mode are quite quite experimental and usually do not produce good results in my experience... Just have fun with the simplest linear mode ;)

— Reply to this email directly, view it on GitHub https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel/issues/7#issuecomment-1371004639, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA7AYZVKTRSUZXOBOKSZF3WQWC4HANCNFSM6AAAAAATQNDCJE . You are receiving this because you authored the thread.Message ID: @.*** com>