add segmind vega

This commit is contained in:
Vladimir Mandic
2023-12-16 18:06:10 -05:00
parent 86af00ce36
commit b9df9be5a5
7 changed files with 20 additions and 4 deletions
+4 -2
View File
@@ -657,7 +657,8 @@ def save_video_atomic(images, filename, video_type: str = 'none', duration: floa
for i in range(len(video_frames)):
img = cv2.cvtColor(video_frames[i], cv2.COLOR_RGB2BGR)
video_writer.write(img)
shared.log.info(f'Save video: file="{filename}" frames={len(frames)} duration={duration} fourcc={fourcc}')
size = os.path.getsize(filename)
shared.log.info(f'Save video: file="{filename}" frames={len(frames)} duration={duration} fourcc={fourcc} size={size}')
if video_type.lower() == 'gif' or video_type.lower() == 'png':
append = images.copy()
image = append.pop(0)
@@ -672,7 +673,8 @@ def save_video_atomic(images, filename, video_type: str = 'none', duration: floa
duration = 1000.0 * duration / frames,
loop = 0 if loop else 1,
)
shared.log.info(f'Save video: file="{filename}" frames={len(append) + 1} duration={duration} loop={loop}')
size = os.path.getsize(filename)
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):
+4
View File
@@ -634,6 +634,10 @@ def detect_pipeline(f: str, op: str = 'model', warning=True):
if shared.backend == shared.Backend.ORIGINAL:
warn(f'Model detected as SD XL instruct pix2pix model, but attempting to load using backend=original: {op}={f} size={size} MB')
guess = 'Stable Diffusion XL Instruct'
elif size > 3138 and size < 3142: #3140
if shared.backend == shared.Backend.ORIGINAL:
warn(f'Model detected as Segmind Vega model, but attempting to load using backend=original: {op}={f} size={size} MB')
guess = 'Stable Diffusion XL'
else:
guess = 'Stable Diffusion'
# guess by name
+2 -1
View File
@@ -68,7 +68,8 @@ def pil_to_temp_file(self, img: Image, dir: str, format="png") -> str: # pylint:
with tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir) as tmp:
name = tmp.name
img.save(name, pnginfo=(metadata if use_metadata else None))
shared.log.debug(f'Saving temp: image="{name}"')
size = os.path.getsize(name)
shared.log.debug(f'Saving temp: image="{name}" resolution={img.width}x{img.height} size={size}')
params = ', '.join([f'{k}: {v}' for k, v in img.info.items()])
params = params[12:] if params.startswith('parameters: ') else params
with open(os.path.join(paths.data_path, "params.txt"), "w", encoding="utf8") as file: