Giter Site home page Giter Site logo

kahsolt / stable-diffusion-webui-prompt-travel Goto Github PK

View Code? Open in Web Editor NEW
247.0 6.0 21.0 47.19 MB

Travel between prompts in the latent space to make pseudo-animation, extension script for AUTOMATIC1111/stable-diffusion-webui.

License: The Unlicense

Python 93.08% Batchfile 6.92%
stable-diffusion stable-diffusion-webui stable-diffusion-webui-plugin ai-painting extensions animation pseudo-animation

stable-diffusion-webui-prompt-travel's Introduction

stable-diffusion-webui-prompt-travel

Travel between prompts in the latent space to make pseudo-animation, extension script for AUTOMATIC1111/stable-diffusion-webui.

Last Commit GitHub issues GitHub stars GitHub forks Language License

:stable-diffusion-webui-prompt-travel

Try interpolating on the hidden vectors of conditioning prompt to make seemingly-continuous image sequence, or let's say a pseudo-animation. 😀
Not only prompts! We also support non-prompt conditions, read => README_ext.md ~

⚠ 我们成立了插件反馈 QQ 群: 616795645 (赤狐屿),欢迎出建议、意见、报告bug等 (w
⚠ We have a QQ chat group (616795645) now, any suggestions, discussions and bug reports are highly wellllcome!!

ℹ 实话不说,我想有可能通过这个来做ppt童话绘本甚至本子……
ℹ 聪明的用法:先手工盲搜两张好看的图 (只有prompt差异),然后再尝试在其间 travel :lolipop:

⚠ Remeber to check "Always save all generated images" on in the settings tab, otherwise "upscaling" and "saving intermediate images" would not work. ⚠ 记得在设置页勾选 “总是保存所有生成的图片”,否则 上采样 与 保存中间图片 将无法工作。

Change Log

⚪ Compatibility

The latest version v3.1 is synced & tested with:

⚪ Features

  • 2023/07/31: v3.1 supports SDXL v1.0 models
  • 2023/07/05: v3.0 re-impl core with sd-webui v1.4.0 callbacks; this new implementation will be slower, but more compatible with other extensions
  • 2023/04/13: v2.7 add RIFE to controlnet-travel, skip fusion (experimental)
  • 2023/03/31: v2.6 add a tkinter GUI for postprocess toolchain
  • 2023/03/30: v2.5 add controlnet-travel script (experimental), interpolating between hint conditions instead of prompts, thx for the code base from sd-webui-controlnet
  • 2023/02/14: v2.3 integrate basic function of depth-image-io for depth2img models
  • 2023/01/27: v2.2 add 'slerp' linear interpolation method
  • 2023/01/22: v2.1 add experimental 'replace' mode again, it's not smooth interpolation
  • 2023/01/20: v2.0 add optional external post-processing pipeline to highly boost up smoothness, greate thx to Real-ESRGAN and RIFE!!
  • 2023/01/16: v1.5 add upscale options (issue #12); add 'embryo' genesis, reproducing idea of stable-diffusion-animation except FILM support (issue #11)
  • 2023/01/12: v1.4 remove 'replace' & 'grad' mode support, due to webui's code change
  • 2022/12/11: v1.3 work in a more 'successive' way, idea borrowed from deforum ('genesis' option)
  • 2022/11/14: v1.2 walk by substituting token embedding ('replace' mode)
  • 2022/11/13: v1.1 walk by optimizing condition ('grad' mode)
  • 2022/11/10: v1.0 interpolate linearly on condition/uncondition ('linear' mode)

⚪ Fixups

  • 2023/12/29: fix bad ffmpeg envvar, update controlnet to v1.1.424
  • 2023/07/05: update controlnet to v1.1.229
  • 2023/04/30: update controlnet to v1.1.116
  • 2023/03/29: v2.4 bug fixes on script hook, now working correctly with extra networks & sd-webui-controlnet
  • 2023/01/31: keep up with webui's updates, (issue #14: ImportError: cannot import name 'single_sample_to_image')
  • 2023/01/28: keep up with webui's updates, extra-networks rework
  • 2023/01/16: v1.5 apply zero padding when condition length mismatch (issue #10: RuntimeError: The size of tensor a (77) must match the size of tensor b (154) at non-singleton dimension 0), typo in demo filename
  • 2023/01/12: v1.4 keep up with webui's updates (issue #9: AttributeError: 'FrozenCLIPEmbedderWithCustomWords' object has no attribute 'process_text')
  • 2022/12/13: #bdd8bed fixup no working when negative prompt is left empty (issue #6: neg_prompts[-1] IndexError: List index out of range)
  • 2022/11/27: v1.2-fix2 keep up with webui's updates (error ImportError: FrozenCLIPEmbedderWithCustomWords)
  • 2022/11/20: v1.2-fix1 keep up with webui's updates (error AttributeError: p.all_negative_prompts[0])

⚠ this script will NOT probably support the schedule syntax (i.e.: [prompt:prompt:number]), because interpolate on mutable conditions requires sampler level tracing which is hard to maintain :(
⚠ this script will NOT probably work together with hires.fix due to some inner conceptual/logical conflict of denoising_strength, you can alternatively perform batch-upscale then batch-img2img.

How it works?

  • input multiple lines in the prompt/negative-prompt box, each line is called a stage
  • generate images one by one, interpolating from one stage towards the next (batch configs are ignored)
  • gradually change the digested inputs between prompts
    • freeze all other settings (steps, sampler, cfg factor, seed, etc.)
    • note that only the major seed will be forcely fixed through all processes, you can still set subseed = -1 to allow more variances
  • export a video!

⚪ Txt2Img

sampler \ genesis fixed successive embryo
Eular a t2i-f-euler_a t2i-s-euler_a t2i-e-euler_a
DDIM t2i-f-ddim t2i-s-ddim t2i-e-ddim

⚪ Img2Img

sampler \ genesis fixed successive embryo
Eular a i2i-f-euler_a i2i-s-euler_a i2i-e-euler_a
DDIM i2i-f-ddim i2i-s-ddim i2i-e-ddim

post-processing pipeline (case i2i-f-ddim):

w/o. post-processing w/. post-processing
i2i-f-ddim i2i-f-ddim-pp

other stuff:

reference image for img2img embryo image decoded
case i2i-e-euler_a with embryo_step=8
i2i-ref embryo

⚪ ControlNet support

prompt-travel with ControlNet (depth) controlnet-travel (depth)
ctrlnet-ref ctrlnet-depth

Example above run configure:

Prompt:
(((masterpiece))), highres, ((boy)), child, cat ears, white hair, red eyes, yellow bell, red cloak, barefoot, angel, [flying], egyptian
((masterpiece)), highres, ((girl)), loli, cat ears, light blue hair, red eyes, magical wand, barefoot, [running]

Negative prompt:
(((nsfw))), ugly,duplicate,morbid,mutilated,tranny,trans,trannsexual,mutation,deformed,long neck,bad anatomy,bad proportions,extra arms,extra legs, disfigured,more than 2 nipples,malformed,mutated,hermaphrodite,out of frame,extra limbs,missing arms,missing legs,poorly drawn hands,poorty drawn face,mutation,poorly drawn,long body,multiple breasts,cloned face,gross proportions, mutated hands,bad hands,bad feet,long neck,missing limb,malformed limbs,malformed hands,fused fingers,too many fingers,extra fingers,missing fingers,extra digit,fewer digits,mutated hands and fingers,lowres,text,error,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,text font ufemale focus, poorly drawn, deformed, poorly drawn face, (extra leg:1.3), (extra fingers:1.2),out of frame

Steps: 15
CFG scale: 7
Clip skip: 1
Seed: 114514
Size: 512 x 512
Model hash: animefull-final-pruned.ckpt
Hypernet: (this is my secret :)

Options

  • prompt: (list of strings)
  • negative prompt: (list of strings)
    • input multiple lines of prompt text
    • we call each line of prompt a stage, usually you need at least 2 lines of text to starts travel
    • if len(positive_prompts) != len(negative_prompts), the shorter one's last item will be repeated to match the longer one
  • mode: (categorical)
    • linear: linear interpolation on condition/uncondition of CLIP output
    • replace: gradually replace of CLIP output
      • replace_dim: (categorical)
        • token: per token-wise vector
        • channel: per channel-wise vector
        • random: per point-wise element
      • replace_order: (categorical)
        • similiar: from the most similiar first (L1 distance)
        • different: from the most different first
        • random: just randomly
    • embryo: pre-denoise few steps, then hatch a set of image from the common embryo by linear interpolation
  • steps: (int, list of int)
    • number of images to interpolate between two stages
    • if int, constant number of travel steps
    • if list of int, length should match len(stages)-1, separate by comma, e.g.: 12, 24, 36
  • genesis: (categorical), the a prior for each image frame
    • fixed: starts from pure noise in txt2img pipeline, or from the same ref-image given in img2img pipeline
    • successive: starts from the last generated image (this will force txt2img turn to actually be img2img from the 2nd frame on)
    • embryo: starts from the same half-denoised image, see => How does it work?
      • (experimental) it only processes 2 lines of prompts, and does not interpolate on negative_prompt :(
  • genesis_extra_params
    • denoise_strength: (float), denoise strength in img2img pipelines (for successive)
    • embryo_step: (int or float), steps to hatch the common embryo (for embryo)
      • if >= 1, taken as step cout
      • if < 1, taken as ratio of total step
  • video_*
    • fps: (float), FPS of video, set 0 to disable file saving
    • fmt: (categorical), export video file format
    • pad: (int), repeat beginning/ending frames, giving a in/out time
    • pick: (string), cherry pick frames by python slice syntax before padding (e.g.: set ::2 to get only even frames, set :-1 to drop last frame)

Installation

Easiest way to install it is to:

  1. Go to the "Extensions" tab in the webui, switch to the "Install from URL" tab
  2. Paste https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel.git into "URL for extension's git repository" and click install
  3. (Optional) You will need to restart the webui for dependencies to be installed or you won't be able to generate video files

Manual install:

  1. Copy this repo folder to the 'extensions' folder of https://github.com/AUTOMATIC1111/stable-diffusion-webui
  2. (Optional) Restart the webui

Post-processing pipeline

There are still two steps away from a really smooth and high resolution animation, namely image super-resolution & video frame interpolation (see third-party tools below).
⚠ Media data processing is intrinsic resource-exhausting, and it's also not webui's work or duty, hence we separated it out. 😃

setup once

⚪ auto install (Windows)

  • run cd tools & install.cmd
  • trouble shooting
    • if you got any file system access errors like Access denied., try run it again until you see Done! without errors 😂
    • if you got SSL errors about curl schannel ... Unknown error ... certificate., the downloader not work due to some SSL security reasons, just turn to install manually...
  • you will have four components: Busybox, Real-ESRGAN, RIFE and FFmpeg installed under the tools folder

⚪ manually install (Windows/Linux/Mac)

ℹ Understand the tools folder layout first => tools/README.txt
ℹ If you indeed wanna put the tools elsewhere, modify paths in tools/link.cmd and run cd tools & link.cmd 😉

For Windows:

  • download Busybox
  • download Real-ESRGAN (e.g.: realesrgan-ncnn-vulkan-20220424-windows.zip)
    • (optional) download interesting seperated model checkpoints (e.g.: realesr-animevideov3.pth)
  • download rife-ncnn-vulkan bundle (e.g.: rife-ncnn-vulkan-20221029-windows.zip )
  • download FFmpeg binary (e.g.: ffmpeg-release-full-shared.7z or ffmpeg-git-full.7z)

For Linux/Mac:

  • download Real-ESRGAN and rife-ncnn-vulkan, put them according to the tools folder layout, manually apply chmod 755 to the executables
  • ffmpeg can be easily found in your app store or package manager, run like apt install ffmpeg; DO NOT need to link it under tools folder

run each time

⚪ tkinter GUI (Windows/Linux/Mac)

manager

For Windows:

  • run manager.cmd, to start webui's python venv
  • run the DOSKEY install (only setup once)
  • run the DOSKEY run

For Linux/Mac:

  • run ../../venv/Scripts/activate, to start webui's python venv
  • run pip install -r requirements.txt (only setup once)
  • run python manager.py

ℹ find usage help message in right click pop menu~

cmd script (Windows) - deprecated

  • check params in postprocess-config.cmd
  • pick one way to start 😃
    • run postprocess.cmd path/to/<image_folder> from command line
    • drag & drop any image folder over postprocess.cmd icon
  • once processing finished, the explorer will be auto lauched to locate the generated file named with synth.mp4

Related Projects

⚪ extensions that inspired this repo

⚪ third-party tools

⚪ my other experimental toy extensions


by Armit 2022/11/10

stable-diffusion-webui-prompt-travel's People

Contributors

0xflotus avatar hackdamdys avatar kahsolt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

stable-diffusion-webui-prompt-travel's Issues

TypeError: 'NoneType' object is not subscriptable

Traceback (most recent call last):
File "S:\Games\stable-diffusion-webui\modules\ui.py", line 188, in f
res = list(func(*args, **kwargs))
File "S:\Games\stable-diffusion-webui\webui.py", line 57, in f
res = func(*args, **kwargs)
File "S:\Games\stable-diffusion-webui\modules\txt2img.py", line 46, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "S:\Games\stable-diffusion-webui\modules\scripts.py", line 317, in run
processed = script.run(p, *script_args)
File "S:\Games\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 537, in run
if mode == 'linear' : images, info = self.run_linear (p, pos_prompts, neg_prompts, steps, show_debug)
File "S:\Games\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 595, in run_linear
from_pos_hidden, from_neg_hidden, prompts, seeds, subseeds = process_images_prompt_to_cond(p)
File "S:\Games\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 69, in process_images_prompt_to_cond
file.write(processed.infotext(p, 0))
File "S:\Games\stable-diffusion-webui\modules\processing.py", line 286, in infotext
return create_infotext(p, self.all_prompts, self.all_seeds, self.all_subseeds, comments=[], position_in_batch=index % self.batch_size, iteration=index // self.batch_size)
File "S:\Games\stable-diffusion-webui\modules\processing.py", line 417, in create_infotext
negative_prompt_text = "\nNegative prompt: " + p.all_negative_prompts[0] if p.all_negative_prompts[0] else ""
TypeError: 'NoneType' object is not subscriptable

Getting this error when trying to use prompt travel. Think latest automatic update changed something. Was working fine earlier.

Traceback (most recent call last):

Hello! Is anyone else experiencing errors when using the script with SDXL 0.9?
image
I've been having a great time creating videos using Prompts Travel in the 2.1 models.

Would it be possible to walk between latents from images instead of latents from prompts?

This may be too broad of a change for prompt travel. But given how the script walks from one latent generated by processing a SD prompt to another latent generated by processing a different SD prompt, I'd think it just as possible to walk directly between latents derived from images as well (such as is done in img2img).

We can of course run the prompt travel script from img2img, but we can't transition between two different images, just two different prompts manipulating a single image. There's batch img2img, but that'll run prompt travel once for each image.

Error loading script: prompt_travel.py in A1111's webui

Hi
I´ve seen this issue turning up, but couldn´t figure out how to fix this. please advice.
grateful for help,
best regards
/Mikael

Error loading script: prompt_travel.py
Traceback (most recent call last):
File "C:\Users\Mikael\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "C:\Users\Mikael\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\Mikael\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py",
line 34, in
from modules.prompt_parser import DictWithShape
ImportError: cannot import name 'DictWithShape' from 'modules.prompt_parser'
(C:\Users\Mikael\stable-diffusion-webui\modules\prompt_parser.py)

'Refiner' option on Automatic1111 causes TypeError

When you use A1111's refiner feature, regardless of whether the first model is derived from sd1.5 or sdxl, it generates the first and last frames fine, but then hits a TypeError.

Traceback (most recent call last):
File "/Users/**redacted**/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 621, in run
runner()
File "/Users/**redacted**/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 655, in run_linear
process_p()
File "/Users/**redacted**/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 438, in process_p_binding_
proc = process_images(self.p)
File "/Users/**redacted**/stable-diffusion-webui/modules/processing.py", line 732, in process_images
res = process_images_inner(p)
File "/Users/**redacted**/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
File "/Users/**redacted**/stable-diffusion-webui/modules/processing.py", line 867, 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 "/Users/**redacted**/stable-diffusion-webui/modules/processing.py", line 1140, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 235, in sample
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_samplers_common.py", line 261, in launch_sampling
return func()
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 235, in <lambda>
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/Users/**redacted**/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 594, in sample_dpmpp_2m
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_samplers_cfg_denoiser.py", line 95, in forward
if sd_samplers_common.apply_refiner(self):
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_samplers_common.py", line 185, in apply_refiner
sd_models.reload_model_weights(info=refiner_checkpoint_info)
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_models.py", line 751, in reload_model_weights
load_model(checkpoint_info, already_loaded_state_dict=state_dict)
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_models.py", line 626, in load_model
load_model_weights(sd_model, checkpoint_info, state_dict, timer)
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_models.py", line 353, in load_model_weights
model.load_state_dict(state_dict, strict=False)
File "/Users/**redacted***/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
original(module, state_dict, strict=strict)
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2027, in load_state_dict
load(self, state_dict)
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
load(child, child_state_dict, child_prefix)
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
load(child, child_state_dict, child_prefix)
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
load(child, child_state_dict, child_prefix)
[Previous line repeated 3 more times]
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2009, in load
module._load_from_state_dict(
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_disable_initialization.py", line 226, in <lambda>
conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
File "/Users/**redacted**/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
File "/Users**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_meta_registrations.py", line 1780, in zeros_like
return aten.empty_like.default(
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_ops.py", line 287, in __call__
return self._op(*args, **kwargs or {})
File "/Users/**redacted**/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_refs/__init__.py", line 4254, in empty_like
return torch.empty_strided(
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Using grad mode in automatic 1111 leads to a torch error

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 an inputsparameter is passed to .backward(). Please use .backward() and do not pass itsinputs argument.

NansException on 2nd image in travel sequence when using ControlNet

Script will generate the first image and then throw the following error on the second image generated during the travel

modules.devices.NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.

Automatic1111 and other scripts (Controlnet travel, sd-animation, etc) are working fine. Have tried with a number of different models (1.5, realisticvision). Setting the no-half and upcast cross attention to float32 options produced different errors (not related to the script).

Versions:

Automatic1111 version: [v1.3.0]
python: 3.10.11  
torch: 2.0.1+cu117  
xformers: N/A  
gradio: 3.31.0  
checkpoint: [e6415c4892]

size of prompt tensor will not match if the length difference of two prompts is too large

Traceback (most recent call last):
  File "H:\workshop\diffussion\stable-diffusion-webui\modules\call_queue.py", line 45, in f
    res = list(func(*args, **kwargs))
  File "H:\workshop\diffussion\stable-diffusion-webui\modules\call_queue.py", line 28, in f
    res = func(*args, **kwargs)
  File "H:\workshop\diffussion\stable-diffusion-webui\modules\txt2img.py", line 49, in txt2img
    processed = modules.scripts.scripts_txt2img.run(p, *args)
  File "H:\workshop\diffussion\stable-diffusion-webui\modules\scripts.py", line 337, in run
    processed = script.run(p, *script_args)
  File "H:\workshop\diffussion\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 471, in run
    images, info = self.run_linear()
  File "H:\workshop\diffussion\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 566, in run_linear
    inter_pos_hidden = weighted_sum(from_pos_hidden, to_pos_hidden, alpha, kind='pos')
  File "H:\workshop\diffussion\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 510, in weighted_sum
    condC = (1 - alpha) * condA + (alpha) * condB
RuntimeError: The size of tensor a (77) must match the size of tensor b (154) at non-singleton dimension 0

AttributeError: 'FrozenCLIPEmbedderWithCustomWords' object has no attribute 'process_text'

I'm running SD WebUI latest branch (0b8911d) in Google Colab using a notebook from TheLastBen

Getting this error:

Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 45, in f
    res = list(func(*args, **kwargs))
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 28, in f
    res = func(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/txt2img.py", line 49, in txt2img
    processed = modules.scripts.scripts_txt2img.run(p, *args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 337, in run
    processed = script.run(p, *script_args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 683, in run
    if   mode == 'linear' : images, info = self.run_linear()
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 749, in run_linear
    from_pos_hidden, from_neg_hidden, prompts, seeds, subseeds = process_images_prompt_to_cond(p)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 161, in process_images_prompt_to_cond
    uc, uc_tokens, uc_weights = get_learned_conditioning(shared.sd_model, negative_prompts, p.steps)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 258, in get_learned_conditioning
    conds, tokens, weights = LatentDiffusion_get_learned_conditioning(model, texts)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 409, in LatentDiffusion_get_learned_conditioning
    c, tokens, weights = FrozenCLIPEmbedderWithCustomWords_forward(self.cond_stage_model, c)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 394, in FrozenCLIPEmbedderWithCustomWords_forward
    batch_multipliers, remade_batch_tokens, used_custom_terms, hijack_comments, hijack_fixes, token_count = text_to_token(self, text)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 331, in text_to_token
    batch_multipliers, remade_batch_tokens, used_custom_terms, hijack_comments, hijack_fixes, token_count = self.process_text(text)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1269, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'FrozenCLIPEmbedderWithCustomWords' object has no attribute 'process_text'

ModuleNotFoundError: No module named '_tkinter'

I'm in auto1111
version: [1.6.0]
python: 3.10.11
torch: 2.0.1+cu118
xformers: 0.0.22

[ControlNet-Travel] extension Mikubill/sd-webui-controlnet found, ControlNet-Travel loaded :)
*** Error loading script: controlnet_travel.py
Traceback (most recent call last):
File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 45, in
from manager import run_cmd
File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\manager.py", line 12, in
from PIL.ImageTk import PhotoImage
File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\PIL\ImageTk.py", line 28, in
import tkinter
File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\tkinter_init
.py", line 37, in
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

But when I run python -m tkinter it says that it is installed. Any thoughts?

TypeError: Script.extra_networks_deactivate() missing 1 required positional argument: 'extra_network_data'

When running under Frame genesis = embryo, it will prompt this error when it is alomst finish:

Traceback (most recent call last): File "C:\Users\aaaa\stable-diffusion-webui\modules\call_queue.py", line 57, in f res = list(func(*args, **kwargs)) File "C:\Users\aaaa\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(*args, **kwargs) File "C:\Users\aaaa\stable-diffusion-webui\modules\txt2img.py", line 53, in txt2img processed = modules.scripts.scripts_txt2img.run(p, *args) File "C:\Users\aaaa\stable-diffusion-webui\modules\scripts.py", line 407, in run processed = script.run(p, *script_args) File "C:\Users\aaaa\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 766, in run images, info = runner(p) File "C:\Users\aaaa\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 792, in run_linear return self.run_linear_embryo(p) File "C:\Users\aaaa\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 926, in run_linear_embryo self.extra_networks_deactivate(from_extra_network_data) TypeError: Script.extra_networks_deactivate() missing 1 required positional argument: 'extra_network_data'

I suspect the StableDiffusionProcessing p is missed in prompt_travel.py Ln926 and Ln 927?

self.extra_networks_deactivate(from_extra_network_data)

Adding a 'p' works in my case:

self.extra_networks_deactivate(p, from_extra_network_data)

IndexError: List index out of range

Traceback (most recent call last): File "/notebooks/stable-diffusion-webui/modules/call_queue.py", line 45, in f res = list(func(*args, **kwargs)) File "/notebooks/stable-diffusion-webui/modules/call_queue.py", line 28, in f res = func(*args, **kwargs) File "/notebooks/stable-diffusion-webui/modules/txt2img.py", line 46, in txt2img processed = modules.scripts.scripts_txt2img.run(p, *args) File "/notebooks/stable-diffusion-webui/modules/scripts.py", line 317, in run processed = script.run(p, *script_args) File "/notebooks/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 517, in run while len(neg_prompts) < n_stages: neg_prompts.append(neg_prompts[-1]) IndexError: list index out of range

Am using a 48GB vram A6000 on Gradient, and i get this error whenever i try to run a generation, might be doing something wrong though

Do not work with SD.Next Diffusers

Hi. Thank you for this script
I try to use it in one of the best forks of Auto1111 - "SD.Next"
So, after last update I need to edit manually prompt-parser.py to add

class DictWithShape(dict):
    def __init__(self, x, shape):
        super().__init__()
        self.update(x)

    @property
    def shape(self):
        return self["crossattn"].shape

but then I have this problem on diffusers backend

n_stages: 3
n_frames: 23
steps: [10, 10]
seed: 1301783812
subseed: -1.0
subseed_strength: 0
[stage 1/3]
  pos prompt: a dog
  neg prompt:
Progress  2.15it/s ██████████████████████████████████████ 100% 20/20 00:09 00:00
[stage 2/3]
  pos prompt: a cat
  neg prompt:
Progress  2.11it/s ██████████████████████████████████████ 100% 20/20 00:09 00:00
Traceback (most recent call last):
  File "D:\auto-latest\automatic\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 584, in run
    # Pack parameters
  File "D:\auto-latest\automatic\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 644, in run_linear
    process_p()
  File "D:\auto-latest\automatic\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 136, in wrapper
  File "D:\auto-latest\automatic\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 129, in cond_align
    CHOICES_REPLACE_DIM     = [x.value for x in ModeReplaceDim]
AttributeError: 'NoneType' object has no attribute 'shape'

Can you help with it?

Runtime error "AttributeError: 'TypeVar' object has no attribute 'ToTensor'" when SSIM enabled

I'm in a Vast.ai instance running the runpod webui 10.1.1 image. This error shows after the first pass of generations when SSIM is enabled. Full stack trace:

Traceback (most recent call last):
File "/workspace/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 578, in run
runner()
File "/workspace/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 663, in run_linear
) = self.ssim_loop(
File "/workspace/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 842, in ssim_loop
transform = T.ToTensor()
AttributeError: 'TypeVar' object has no attribute 'ToTensor'

I've already tried removing the --skip-install command line argument, which has helped with other extension issues.

Prompt Travel won't install properly

Hello!
I've seen either this issue, or similar issues pop up a few times, but I can't seem to get prompt travel to install properly.
I greatly appreciate any form of help.
Best regards,
HalLupus

I'm on macOS version 13.5.3
I've also recently (yesterday) did a git pull after the extension wasn't working on my previous version, and now I'm on sd version [v1.6.0-2-g4afaaf8a]

What I get when I start up sd:

*** Error loading script: controlnet_travel.py
Traceback (most recent call last):
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/controlnet_travel.py", line 45, in
from scripts.prompt_travel import *
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 24, in

*** Error loading script: prompt_travel.py
Traceback (most recent call last):
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/(username)/Documents/stable-diffusion/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 24, in

Clarify: how to travel between 2 prompts?

Extension script for AUTOMATIC1111/stable-diffusion-webui to travel between prompts in latent space.

I just wrote an extension to travel between several prompts and generates a video just alike the seed_travel does

I don't really know how to travel between prompts, or if this feature is here at all. could you clarify? I am using the grad mode.

Eg: travel from a cat on a horse to furnace brewing rainbow steak

There is no second promptbox to add another prompt to travel to. I believe this only works with one prompt, where you are tweaking the prompt in miniscule ways.

Working with Inpainting

Got this suggestion from a comment on one of my reddit posts, they asked if it would be possible to have the extension work with inpainting so we can say, mask only the character and travel only that, keeping the background consistent throughout.
Currently running the script in the inpainting session throws error(see below) for me, I am assuming this would not be a difficult change since it would effectively work like the 'successive' mode or just normal img2img but with a mask parameter.

The error traceback:

Traceback (most recent call last):
  File "/path/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/path/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/path/stable-diffusion-webui/modules/img2img.py", line 169, in img2img
    processed = modules.scripts.scripts_img2img.run(p, *args)
  File "/path/stable-diffusion-webui/modules/scripts.py", line 399, in run
    processed = script.run(p, *script_args)
  File "/path/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 766, in run
    images, info = runner(p)
  File "/path/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 814, in run_linear
    gen_image(from_pos_hidden, from_neg_hidden, prompts, seeds, subseeds)
  File "/path/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 799, in gen_image
    proc = process_images_cond_to_image(p, pos_hidden, neg_hidden, prompts, seeds, subseeds)
  File "/path/stable-diffusion-webui/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 322, in process_images_cond_to_image
    if opts.save_mask:
  File "/path/stable-diffusion-webui/modules/shared.py", line 552, in __getattr__
    return super(Options, self).__getattribute__(item)
AttributeError: 'Options' object has no attribute 'save_mask'

Feature Request: RIFE implementation

I love Prompt Travel and it works quite well, in some ways better than Seed Travel. That said, there is one thing that Seed Travel has implemented that is very very nice -- and that is the RIFE passes for creating interpolated frames to smooth the animation results.

I wonder if it is possible to implement RIFE passes for Prompt Travel (and eventually ControlNet Travel) in the same way that the Seed Travel project has done, it will make very smooth animations with Prompt Travel possible. Thanks for your consideration!

Using "prompt editing" ([from:to:when]) breaks prompt travel

When traveling between prompts that use prompt editing, it appears as if it's switching completely over to the original prompt when the prompt edit threshold is reached. If the prompt edit happens very early on (like [red:blue:0.2]), barely anything changes until the last image.

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

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: mcmonkeyprojects/sd-dynamic-thresholding#2

Prompt-Travel is not working anymore after I updated the extension

Hello, and thanks for your work.

Prompt-Travel works no longer on my configuration after the last update.

SYSTEM INFORMATION: Linux 6.4.8-arch1-1 x86_64

Browser: Mozilla Firefox 116.0

Traceback:

`2023-08-07 00:09:04,427 - ControlNet - INFO - ControlNet v1.1.234
[ControlNet-Travel] extension Mikubill/sd-webui-controlnet found, ControlNet-Travel loaded :)
Error loading script: controlnet_travel.py
Traceback (most recent call last):
  File "/home/fz/.virtualenv/stablediffusion/modules/scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "/home/fz/.virtualenv/stablediffusion/modules/script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/fz/.virtualenv/stablediffusion/extensions/stable-diffusion-webui-prompt-travel/scripts/controlnet_travel.py", line 44, in <module>
    from scripts.prompt_travel import *
  File "/home/fz/.virtualenv/stablediffusion/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 34, in <module>
    from modules.prompt_parser import DictWithShape
ImportError: cannot import name 'DictWithShape' from 'modules.prompt_parser' (/home/fz/.virtualenv/stablediffusion/modules/prompt_parser.py)

Error loading script: prompt_travel.py
Traceback (most recent call last):
  File "/home/fz/.virtualenv/stablediffusion/modules/scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "/home/fz/.virtualenv/stablediffusion/modules/script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/fz/.virtualenv/stablediffusion/extensions/stable-diffusion-webui-prompt-travel/scripts/prompt_travel.py", line 34, in <module>
    from modules.prompt_parser import DictWithShape
ImportError: cannot import name 'DictWithShape' from 'modules.prompt_parser' (/home/fz/.virtualenv/stablediffusion/modules/prompt_parser.py)`

Could you please give me any support?
Thank you in advance

Feature Request: Support Upscaling before generating video.

Right now, for both this extension and for seed travel, a user who wants to upscale their animation will need to individual (or in a batch) upscale each image and then will have to convert these images into an mp4 or .gif themselves.

Maybe we should support allowing a user to do this in the UI before the final generated video. Besides, you'll be able to show off 8K animations really easily to motivate folks to use it!

controlnet travel does nothing

I put the path of the folder correctly
I press generate but nothing happens

prompt travel latest version
controlnet version 1.1

ModuleNotFoundError: No module named 'tkinter'

I'm running into the following problem:

[ControlNet-Travel] extension Mikubill/sd-webui-controlnet found, ControlNet-Travel loaded :)
*** Error loading script: controlnet_travel.py
    Traceback (most recent call last):
      File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, 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 "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 45, in <module>
        from manager import run_cmd
      File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\manager.py", line 12, in <module>
        from PIL.ImageTk import PhotoImage
      File "E:\StabilityMatrix\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\PIL\ImageTk.py", line 28, in <module>
        import tkinter
    ModuleNotFoundError: No module named 'tkinter'

I've gone into my venv and run a python script that confirmed that tkinter IS installed. So I'm not sure what the issue is.

I'm running Auto1111 version: [1.6.0]
python: 3.10.11
torch: 2.0.1+cu118

Any thoughts? Is it possible that prompt-travel is interfering with controlnet somehow?

New controlnet version is causing an error

ControlNet travel script error

2023-12-08 23:05:58,054 - ControlNet - INFO - unit_separate = True, style_align = False
2023-12-08 23:05:58,054 - ControlNet - INFO - Loading model from cache: diff_control_sd15_temporalnet_fp16 [adc6bd97]
2023-12-08 23:05:58,055 - ControlNet - INFO - Loading preprocessor: none
2023-12-08 23:05:58,056 - ControlNet - INFO - preprocessor resolution = 576
*** Error running process: C:\Users\Admin\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
Traceback (most recent call last):
File "C:\Users\Admin\stable-diffusion-webui\modules\scripts.py", line 619, in process
script.process(p, *script_args)
File "C:\Users\Admin\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1053, in process
self.controlnet_hack(p)
File "C:\Users\Admin\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1042, in controlnet_hack
self.controlnet_main_entry(p)
File "C:\Users\Admin\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1014, in controlnet_main_entry
self.latest_network.hook(model=unet, sd_ldm=sd_ldm, control_params=forward_params, process=p,
TypeError: hook_hijack() got an unexpected keyword argument 'batch_option_uint_separate'

Suggestions to improve grad videos

I've experimented quite a bit with the extension and ended up in video/gif editor every time, so decided to list some things that seemed annoying yet could probably be easily remedied.

These improvements seem to be trivial:

  • Option to only output every other frame into video (solves pingpong issue, can technically be done by using even step count)
  • Option to change interrupt behavior so that last two frames (the unfinished one and final frame, probaby not reached) are not added.
  • Option to start and finish video at some percentage (20% to 80% tend to be most meaningful for 2-point travel)

And these might be a lot to ask:

  • Option to output a GIF (pingpong or repeating, with optionally extended durtion of first/last frames)
  • Option to drop frames that have high similarity (with any reasonable kind of threshold)

IndexError: list index out of range ( RIFE )

Hello
I have been trying for days to obtain the RIFE video from "Prompt Travel," but I have been unable to find it. It seems to be available only through "Controlnet Travel.
Screenshot 2023-07-03 23491s7
I encountered an error while attempting to create a video using prompts for RIFE interpolation. Is there any method or alternative way to generate a video with RIFE interpolation from prompts?

Starting prompt travel before midnight but finishing after cause multiple date folder to be created and image numbering continuity is lost

I happened to run it over midnight and now my images are split into two folders (date-named) "2023-02-18" and "2023-02-19", and the second one restarted the image numbering at 00000.

Request is to keep the same initial output folder (and sequential numbering) is as created/used when the first image of the travel batch is saved.

Work around is to manually renumber and move everything. I'm glad this wasn't a big one.

If this is something the main UI controls and cannot be fixed in a script, please let me know so I can file an issue on that repo. I don't know if other scripts have this issue in common.
Screenshot 2023-02-19 at 12 26 20 AM

Exception: Moviepy: ImageSequenceClip requires all images to be the same size && IndexError: tuple index out of range

I keep getting this when I try to run prompt-travel with AnmiDiff and ControlNet

Traceback (most recent call last):
File "C:\tools\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 621, in run
runner()
File "C:\tools\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 668, in run_linear
imgs = process_p(append=False) # stash it to make order right
File "C:\tools\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 438, in process_p_binding_
proc = process_images(self.p)
File "C:\tools\stable-diffusion-webui\modules\processing.py", line 734, in process_images
res = process_images_inner(p)
File "C:\tools\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff_cn.py", line 94, in hacked_processing_process_images_hijack
unit.batch_images = shared.listfiles(unit.batch_images)
File "C:\tools\stable-diffusion-webui\modules\util.py", line 13, in listfiles
filenames = [os.path.join(dirname, x) for x in sorted(os.listdir(dirname), key=natural_sort_key) if not x.startswith(".")]
TypeError: listdir: path should be string, bytes, os.PathLike or None, not list

Traceback (most recent call last):
File "C:\tools\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 355, in save_video
clip = ImageSequenceClip(seq, fps=video_fps)
File "C:\tools\stable-diffusion-webui\venv\lib\site-packages\moviepy\video\io\ImageSequenceClip.py", line 91, in init
raise Exception("Moviepy: ImageSequenceClip requires all images to be the same size")
Exception: Moviepy: ImageSequenceClip requires all images to be the same size

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\tools\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 357, in save_video
clip = concatenate_videoclips([ImageClip(img, duration=1/video_fps) for img in seq], method='compose')
File "C:\tools\stable-diffusion-webui\venv\lib\site-packages\moviepy\video\compositing\concatenate.py", line 75, in concatenate_videoclips
w = max(r[0] for r in sizes)
File "C:\tools\stable-diffusion-webui\venv\lib\site-packages\moviepy\video\compositing\concatenate.py", line 75, in
w = max(r[0] for r in sizes)
IndexError: tuple index out of range

[Bug]: ControlNet Travel script broken? "NameError: name 'self' is not defined"

Hi there! Love the prompt travel script, thank you for this!

I am trying to use ControlNet Travel for the first time, and was super excited to get started, but it appears to be broken. Perhaps I am not using it correctly, but I can't find any issue or discussion related to this script, and there's not much in the readme outside of the cool example you've provided, so I'm not sure what to do... I would really love to get something going soon and maybe there's an easy fix!

In any case, here are steps to reproduce:

  1. Use txt2img to set up a controlnet that you like, add an image to a controlnet module and play until you're satisfied.
  2. Remove the image from the ControlNet module in preparation for batch processing.
  3. Select ControlNet Travel script and add the directory path where you are storing your images.
  4. Hit Generate, you will get "NameError: name 'self' is not defined"
  5. Add your starting image back in to the ControlNet module to see if that's the problem.
  6. Hit Generate, you will get "NameError: name 'self' is not defined"

Full error in terminal:

Error completing request
Arguments: ('task(jdnn5h3kpd9x6h8)', 'a portrait of a CEO for a large company, 8k, cinematic, dramatic, late evening light', 'lens flare', [], 20, 0, False, False, 1, 1, 7, 980000670.0, -1.0, 0, 512, 512, True, 512, 512, False, 0.42, 2, 'Latent', 12, 0, 0, [], 9, True, 'keyword prompt', 'keyword1, keyword2', 'None', 'textual inversion first', 'None', 0.7, 'None', True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, 'x264', 'mci', 10, 0, False, True, True, True, 'intermediate', 'animation', <scripts.external_code.ControlNetUnit object at 0x00000136AA898700>, <scripts.external_code.ControlNetUnit object at 0x00000136AD6B0D90>, <scripts.external_code.ControlNetUnit object at 0x00000136AD6E18A0>, False, '1:1,1:2,1:2', '0:0,0:0,0:1', '0.2,0.8,0.8', 20, 0.2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, False, False, 'positive', 'comma', 0, False, False, '', 1, '', 0, '', 0, '', True, False, False, False, 0, '', 'None', 30, 4, 0, 0, False, 'None', '
', 'None', 30, 4, 0, 0, 4, 0.4, True, 32, None, False, None, False, None, False, 50, False, 4.0, '', 10.0, 'Linear', 3, False, 30.0, True, False, False, 0, 0.0, 'Lanczos', 1, True, 0, 0, 0.001, 75, 0.0, False, True, 10.0, 30.0, True, 0.0, 'Lanczos', 1, 0, 0, 75, 0.0001, 0.0, False, True, '', False, False, False, False, 'Auto', 0.5, 1, 'linear (weight sum)', '5', 'C:\CEOs', 'Lanczos', 2, 0, 0, 'mp4', 3.0, 0, '', True, False, 'linear', 'lerp', 'token', 'random', '30', 'fixed', 1, '8', None, 'Lanczos', 2, 0, 0, 'mp4', 10.0, 0, '', True, False, False) {}
Traceback (most recent call last):
File "C:\SDW\stable-diffusion-webui\modules\call_queue.py", line 56, in f
res = list(func(*args, **kwargs))
File "C:\SDW\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "C:\SDW\stable-diffusion-webui\modules\txt2img.py", line 53, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "C:\SDW\stable-diffusion-webui\modules\scripts.py", line 407, in run
processed = script.run(p, *script_args)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 681, in run
gen_image()
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 664, in gen_image
proc = process_images(p)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 240, in process_images
res = process_images_inner(p)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 402, in process_images_inner
samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
File "C:\SDW\stable-diffusion-webui\modules\processing.py", line 869, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "C:\SDW\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 358, in sample
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
File "C:\SDW\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 234, in launch_sampling
return func()
File "C:\SDW\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 358, in
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
File "C:\SDW\stable-diffusion-webui\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "C:\SDW\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 145, in sample_euler_ancestral
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "C:\SDW\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\SDW\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 126, in forward
x_out = self.inner_model(x_in, sigma_in, cond=make_condition_dict([cond_in], image_cond_in))
File "C:\SDW\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\SDW\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\external.py", line 112, in forward
eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
File "C:\SDW\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\external.py", line 138, in get_eps
return self.inner_model.apply_model(*args, **kwargs)
File "C:\SDW\stable-diffusion-webui\modules\sd_hijack_utils.py", line 17, in
setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
File "C:\SDW\stable-diffusion-webui\modules\sd_hijack_utils.py", line 28, in call
return self.__orig_func(*args, **kwargs)
File "C:\SDW\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 858, in apply_model
x_recon = self.model(x_noisy, t, **cond)
File "C:\SDW\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\SDW\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 1335, in forward
out = self.diffusion_model(x, t, context=cc)
File "C:\SDW\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 312, in
unet.forward = lambda *args, **kwargs: forward2(unethook, *args, **kwargs)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 215, in forward2
return forward(self, *args, **kwargs)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 195, in forward
h = cfg_based_adder(h, control_in, require_inpaint_hijack)
File "C:\SDW\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\controlnet_travel.py", line 48, in cfg_based_adder
if base.shape[0] % 2 == 0 and (self.guess_mode or shared.opts.data.get("control_net_cfg_based_guidance", False)):
NameError: name 'self' is not defined

ImportError: cannot import name 'FrozenCLIPEmbedderWithCustomWords' from 'modules.sd_hijack'

After the most recent update of SD Web UI (AUTOMATIC1111/stable-diffusion-webui@b5050ad) I get this error message in the console:

Error loading script: prompt_travel.py
Traceback (most recent call last):
File "C:\stable-diffusion-webui\modules\scripts.py", line 184, in load_scripts
module = script_loading.load_module(scriptfile.path)
File "C:\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
exec(compiled, module.dict)
File "C:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 264, in
from modules.sd_hijack import FrozenCLIPEmbedderWithCustomWords
ImportError: cannot import name 'FrozenCLIPEmbedderWithCustomWords' from 'modules.sd_hijack' (C:\stable-diffusion-webui\modules\sd_hijack.py)

Successive Frame genesis and ControlNet cannot work together

I am trying to generate images with Successive Frame genesis and ControlNet, but seems it always get the tensor size error. Below is my test set:

Prompt:
Cute Cat
Cute Dog

Frame genesis: successive

ControlNet Prepocessor: depth_midas
ControlNet Model: control_v11fp_sd15_depth

And i am using the suggested version:
AUTOMATIC1111/stable-diffusion-webui: version v1.5.1, tag v1.5.1
Mikubill/sd-webui-controlnet: version v1.1.229, commit eceeec7a7e

Everytime I try this got this error:

Traceback (most recent call last):
File "D:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 621, in run
runner()
File "D:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 681, in run_linear
inter_pos_hidden.value = lerp_fn(from_pos_hidden.value, to_pos_hidden.value, alpha)
File "D:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 169, in wrapper
return fn(condA, condB, *args, **kwargs)
File "D:\stable-diffusion-webui\extensions\stable-diffusion-webui-prompt-travel\scripts\prompt_travel.py", line 176, in weighted_sum
return (1 - alpha) * A + (alpha) * B
RuntimeError: The size of tensor a (78) must match the size of tensor b (77) at non-singleton dimension 1

Is Successive + ControlNet not supported or something happened?

Add hint to setting samples_save to be true

Hey @Kahsolt,

without enabling samples_save ("Always save all generated images") neither the upscaling nor intermediate image saving works due to not creating the respective folder in the prompt_travel folder running controlnet travel.
Please add a hint for that to the README so users don't have to debug themselves why these checkboxes might not do anything.

Thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.