mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
add segmind vega
This commit is contained in:
+4
-2
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user