[X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui
Have you read FAQ on README?
[X] I have updated WebUI and this extension to the latest version
What happened?
When setting the "batch count" option > 1 to generate multiple animations in a single run:
In the AnimateDiff folder, all generated anim filenames and .txt filenames refers to first seed.
The metadata seed in all .txt files is the same one (the first seed).
Steps to reproduce the problem
Go to txt2img.
Set batch count to 2.
Set seed to 666.
Configure AnimateDiff to export gif and txt files.
Click on "generate" to export 2 animations.
In the exported folder (AnimateDiff), we currently have:
00001-666.gif
00001-666.txt
00002-666.gif
00002-666.txt
Drag&drop 00002-666.txt file in the prompt field then recreate the animation, it will produce 00001-666.gif but not the original 00002-666.gif
What should have happened?
AnimateDiff folder content:
00001-666.gif
00001-666.txt
00002-second_seed.gif
00002-second_seed.txt
Seed info in 00002-second_seed.txt should contains second_seed, not 666.
Importing 00002-second_seed.txt using the prompt field, should recreate the second animation, not the first one.
Here is a small patch that fixed the problem for me:
Be cautious, my knowledge of Auto1111 and Python is very limited, and more testing should be done (not tested in img2img, options like reverse etc.)
Sorry for not submitting a PR, it's just a quick fix, and my workflow is not installed yet.
Subject: [PATCH] Export correct seed for batch_count>1
---
Index: scripts/animatediff_output.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scripts/animatediff_output.py b/scripts/animatediff_output.py
--- a/scripts/animatediff_output.py (revision 2f0e68d08028b0440a899c57dcfaf4972a5f0185)
+++ b/scripts/animatediff_output.py (date 1697987907815)
@@ -27,7 +27,7 @@
video_list = [image.copy() for image in res.images[i : i + params.video_length]]
seq = images.get_next_sequence_number(f"{p.outpath_samples}/AnimateDiff", "")
- filename = f"{seq:05}-{res.seed}"
+ filename = f"{seq:05}-{res.all_seeds[(i-1)]}"
video_path_prefix = f"{p.outpath_samples}/AnimateDiff/{filename}"
video_list = self._add_reverse(params, video_list)
@@ -127,7 +127,7 @@
):
video_paths = []
video_array = [np.array(v) for v in video_list]
- infotext = res.info
+ infotext = res.infotexts[index]
use_infotext = shared.opts.enable_pnginfo and infotext is not None
if "PNG" in params.format and shared.opts.data.get("animatediff_save_to_custom", False):
Path(video_path_prefix).mkdir(exist_ok=True, parents=True)
Thanks for the great module (I'm loving it) and the time spent on it.
Have a nice day. :+1:
Is there an existing issue for this?
Have you read FAQ on README?
What happened?
When setting the "batch count" option > 1 to generate multiple animations in a single run:
Steps to reproduce the problem
In the exported folder (AnimateDiff), we currently have:
Drag&drop 00002-666.txt file in the prompt field then recreate the animation, it will produce 00001-666.gif but not the original 00002-666.gif
What should have happened?
AnimateDiff folder content:
Seed info in 00002-second_seed.txt should contains second_seed, not 666. Importing 00002-second_seed.txt using the prompt field, should recreate the second animation, not the first one.
Commit where the problem happens
webui: v1.6.0 extension: v1.9.4 (2f0e68d08028b0440a899c57dcfaf4972a5f0185)
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
Console logs
Additional information
Here is a small patch that fixed the problem for me: Be cautious, my knowledge of Auto1111 and Python is very limited, and more testing should be done (not tested in img2img, options like reverse etc.) Sorry for not submitting a PR, it's just a quick fix, and my workflow is not installed yet.
Thanks for the great module (I'm loving it) and the time spent on it. Have a nice day. :+1: