diff --git a/modules/images.py b/modules/images.py index 2a372faaf..221a184f8 100644 --- a/modules/images.py +++ b/modules/images.py @@ -678,7 +678,7 @@ def save_video_atomic(images, filename, video_type: str = 'none', duration: floa shared.log.info(f'Save video: file="{filename}" frames={len(append) + 1} duration={duration} loop={loop} size={size}') -def save_video(p, images, filename = None, video_type: str = 'none', duration: float = 2.0, loop: bool = False, interpolate: int = 0, scale: float = 1.0, pad: int = 1, change: float = 0.3): +def save_video(p, images, filename = None, video_type: str = 'none', duration: float = 2.0, loop: bool = False, interpolate: int = 0, scale: float = 1.0, pad: int = 1, change: float = 0.3, sync: bool = False): if images is None or len(images) < 2 or video_type is None or video_type.lower() == 'none': return image = images[0] @@ -696,7 +696,11 @@ def save_video(p, images, filename = None, video_type: str = 'none', duration: f if not filename.lower().endswith(video_type.lower()): filename += f'.{video_type.lower()}' filename = namegen.sanitize(filename) - threading.Thread(target=save_video_atomic, args=(images, filename, video_type, duration, loop, interpolate, scale, pad, change)).start() + if not sync: + threading.Thread(target=save_video_atomic, args=(images, filename, video_type, duration, loop, interpolate, scale, pad, change)).start() + else: + save_video_atomic(images, filename, video_type, duration, loop, interpolate, scale, pad, change) + return filename def safe_decode_string(s: bytes): diff --git a/modules/processing.py b/modules/processing.py index 156a33810..6b89e6dd7 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -379,8 +379,8 @@ class Processed: self.subseed_strength = p.subseed_strength self.info = info self.comments = comments - self.width = p.width if hasattr(p, 'width') else self.images[0].width - self.height = p.height if hasattr(p, 'height') else self.images[0].height + self.width = p.width if hasattr(p, 'width') else (self.images[0].width if len(self.images) > 0 else 0) + self.height = p.height if hasattr(p, 'height') else (self.images[0].height if len(self.images) > 0 else 0) self.sampler_name = p.sampler_name self.cfg_scale = p.cfg_scale self.image_cfg_scale = p.image_cfg_scale diff --git a/wiki b/wiki index 0d8ab0f77..0041ca2ab 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 0d8ab0f77d9bb1a1466111ab2816c23bb046c1fa +Subproject commit 0041ca2ab7b57624e5b6448856a1ae88e295636a