Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.
Voice reference: keep it when the context falls back to the encoded ending
Bowen Xue43f768d409b6
diff --git a/freevideo_engine/cli.py b/freevideo_engine/cli.pyindex 8da891a..f60ab43 100644--- a/freevideo_engine/cli.py+++ b/freevideo_engine/cli.py@@ -97,6 +97,8 @@ def main():help='With --continue-from: also give the model the first frame of the whole film as a ''reference picture. Reduces drift over many parts; holds framing and motion close to ''the opening, so leave it off when later parts should move away from it')+ generate.add_argument('--voice-reference', action='store_true',+ help='With --continue-from: use the opening six seconds as a voice reference when the prompt has dialogue')generate.add_argument('--continue-anchor', type=Path, metavar='IMAGE',help='Experimental: a reference picture of your own for a continuation, with no prompt note')generate.add_argument('--allocator-limit-gib', type=float,diff --git a/freevideo_engine/comfy_bridge.py b/freevideo_engine/comfy_bridge.pyindex 59eb37c..d2fb88c 100644--- a/freevideo_engine/comfy_bridge.py+++ b/freevideo_engine/comfy_bridge.py@@ -1155,9 +1155,11 @@ def generate(prompt, width, height, seconds, seed, output_directory, *,release_models=None, export_inputs=None, two_pass=True, encoder_prewarm=None,force_regenerate=False, base_steps=8, refine_steps=3, comfy_metadata=None,prompt_rewrite_report=None, preview=False, refine_from=None, report_extra=None,- continue_from=None, frames=None, first_frame_reference=False):+ continue_from=None, frames=None, first_frame_reference=False, voice_reference=False):if type(first_frame_reference) is not bool:raise ValueError('First-frame reference must be a boolean')+ if type(voice_reference) is not bool:+ raise ValueError('Voice reference must be a boolean')if continue_from is not None:from .continuation import validate_routevalidate_route(two_pass=two_pass, preview=preview, refine_from=refine_from)@@ -1249,6 +1251,8 @@ def generate(prompt, width, height, seconds, seed, output_directory, *,command += ['--continue-from', str(continue_from)]if first_frame_reference:command.append('--first-frame-reference')+ if voice_reference:+ command.append('--voice-reference')if continuation is not None:from .continuation import persist_snapshotcontinuation = persist_snapshot(continuation, run / 'continuation-source.safetensors')diff --git a/freevideo_engine/comfy_chain.py b/freevideo_engine/comfy_chain.pyindex 18ceae9..1e07903 100644--- a/freevideo_engine/comfy_chain.py+++ b/freevideo_engine/comfy_chain.py@@ -39,7 +39,7 @@ def seconds_for_frames(frames, minimum=1.625, maximum=60., step=.1):class ComfyHost:- continuation_inputs = tuple(CONTINUE_INPUTS.values())+ continuation_inputs = (*CONTINUE_INPUTS.values(), 'voice_reference')media_inputs = ('media', 'first', 'last', 'references', 'conditioning')def __init__(self, server):@@ -59,6 +59,8 @@ class ComfyHost:# Each direction is filled once the node offers its input.if name in schema:values[name] = '' if independent else block_inputs[key]+ if 'voice_reference' in schema and values.get('continue_from'):+ values['voice_reference'] = Truereturn valuesdef work_exists(self, path):diff --git a/freevideo_engine/comfy_nodes.py b/freevideo_engine/comfy_nodes.pyindex eacab22..983e4bd 100644--- a/freevideo_engine/comfy_nodes.py+++ b/freevideo_engine/comfy_nodes.py@@ -64,6 +64,8 @@ class FreeVideoGenerate(io.ComfyNode):'Includes the 22 overlap frames when continuing; the saved MP4 contains only new frames.'),io.Boolean.Input('first_frame_reference', display_name='First-frame reference', default=False,optional=True, advanced=True, tooltip='Reduces drift.'),+ io.Boolean.Input('voice_reference', display_name='Voice reference', default=False,+ optional=True, advanced=True, tooltip='Keeps the opening voice consistent in continued dialogue.'),],outputs=[io.Video.Output('video'), io.String.Output('report', display_name='Report JSON')],hidden=[io.Hidden.unique_id, io.Hidden.prompt, io.Hidden.extra_pnginfo],@@ -109,7 +111,7 @@ class FreeVideoGenerate(io.ComfyNode):def execute(cls, text, width, height, seconds, seed, first=None, last=None,references=None, loras=None, conditioning=None, media=None, two_pass=True,force_regenerate=False, base_steps=8, refine_steps=3, preview=False, refine_from='',- continue_from='', frames=0, first_frame_reference=False):+ continue_from='', frames=0, first_frame_reference=False, voice_reference=False):from server import PromptServerfrom .comfy_chain import block_context, block_finished, report_fieldsnode_id = cls.hidden.unique_id@@ -221,6 +223,7 @@ class FreeVideoGenerate(io.ComfyNode):**options,# Only a part that continues another can use it; other requests keep the existing bridge call.**({'first_frame_reference': True} if first_frame_reference is True and options.get('continue_from') else {}),+ **({'voice_reference': True} if voice_reference is True and options.get('continue_from') else {}),**({'report_extra': {'chain': report_fields(chain)}} if chain is not None else {}))relative = output.relative_to(output_root)report = output.with_suffix('.request.json').read_text(encoding='utf-8')diff --git a/freevideo_engine/continuation.py b/freevideo_engine/continuation.pyindex b262bb0..1905c88 100644--- a/freevideo_engine/continuation.py+++ b/freevideo_engine/continuation.py@@ -22,6 +22,8 @@ FIRST_FRAME_NOTE = ('The reference image is the very first frame of this whole f'location, framing and colour tone as in that image throughout.')FIRST_FRAME_MAX_BYTES = 8 * 1024 * 1024FIRST_FRAME_MAX_SIDE = 4096+FIRST_SOUND_MAX_BYTES = 4 * 1024 * 1024+FIRST_SOUND_SECONDS = 6# The picture the model is given is half the side of the film's first frame, but not under this# on its short side: on a real six-part chain it held framing and colour as well as the full# picture for a third of the extra sampling time. Smaller pictures are not tested.@@ -68,13 +70,18 @@ def validate_frames(frames):def validate_route(*, task='t2va', two_pass=True, preview=False, refine_from=None,- media=None, backend=None, anchor=False):+ media=None, backend=None, anchor=False, sound=False):media = media or {}references = media.get('references')valid_reference = (anchor and isinstance(references, list) and len(references) == 1and isinstance(references[0], dict)and references[0].get('kind') == 'image')- if (not supported()[0] or backend not in (None, 'cuda') or task != ('ref2va' if anchor else 't2va')+ valid_task = task == ('ref2va' if anchor else 't2va')+ if sound:+ valid_reference = (not anchor and isinstance(references, list) and len(references) == 1+ and isinstance(references[0], dict) and references[0].get('kind') == 'audio')+ valid_task = task in ('t2va', 'ref2va', 'ref2va_audio') and valid_reference+ if (not supported()[0] or backend not in (None, 'cuda') or not valid_taskor not two_pass or preview or refine_fromor any(media.get(key) for key in ('first', 'last', 'conditioning_info'))or (references and not valid_reference)):@@ -198,6 +205,101 @@ def _chain_first_frame(request, video_path):return pack_first_frame(first_frame_png(video_path))+def pack_first_sound(raw):+ """A bounded stereo PCM16 WAV, starting at the film's first audio sample."""+ import io+ import wave+ try:+ if not isinstance(raw, bytes) or len(raw) > FIRST_SOUND_MAX_BYTES:+ raise ValueError('Invalid first sound')+ with wave.open(io.BytesIO(raw), 'rb') as source:+ rate, samples = source.getframerate(), source.getnframes()+ if (source.getnchannels() != 2 or source.getsampwidth() != 2 or source.getcomptype() != 'NONE'+ or rate <= 0 or not 0 < samples <= round(FIRST_SOUND_SECONDS * rate)+ or len(source.readframes(samples + 1)) != samples * 4):+ raise ValueError('Invalid first sound')+ return dict(format='wav', rate=rate, data=base64.b64encode(raw).decode('ascii'))+ except (ValueError, EOFError, wave.Error, OSError):+ raise ValueError('Invalid first sound') from None+++def unpack_first_sound(value):+ """Recheck the record's WAV, including its declared rate and decoded size."""+ try:+ if (value['format'] != 'wav' or type(value['rate']) is not int+ or not isinstance(value['data'], str)+ or len(value['data']) > (FIRST_SOUND_MAX_BYTES + 2) // 3 * 4):+ raise ValueError('Invalid first sound')+ raw = base64.b64decode(value['data'], validate=True)+ if pack_first_sound(raw) != value:+ raise ValueError('Invalid first sound')+ return raw+ except (KeyError, TypeError, ValueError, OSError):+ raise ValueError('Invalid first sound') from None+++def first_sound_wav(video_path):+ """Decode at most six seconds, at the source rate; duplicate mono without changing its gain."""+ import io+ import wave+ import av+ with av.open(str(video_path)) as container:+ stream = container.streams.audio[0]+ rate = stream.codec_context.sample_rate+ if rate <= 0:+ raise ValueError('Invalid first sound')+ # Read one sample past the size limit to reject an oversized opening, while still+ # accepting a short high-rate source whose actual WAV fits within the bound.+ limit = (FIRST_SOUND_MAX_BYTES - 44) // 4+ count = min(round(FIRST_SOUND_SECONDS * rate), limit + 1)+ saved = 0+ mono = len(stream.codec_context.layout.channels) == 1+ resampler = av.AudioResampler(format='s16', layout='mono' if mono else 'stereo', rate=rate)+ chunks = []+ def keep(frame):+ nonlocal count, saved+ samples = frame.to_ndarray().reshape(-1, 1 if mono else 2)[:count]+ if mono:+ samples = samples.repeat(2, axis=1)+ chunks.append(samples.astype('<i2', copy=False).tobytes())+ count -= len(samples)+ saved += len(samples)+ if saved > limit:+ raise ValueError('Invalid first sound')+ for frame in container.decode(stream):+ for converted in resampler.resample(frame):+ keep(converted)+ if count == 0:+ break+ if count:+ for converted in resampler.resample(None):+ keep(converted)+ target = io.BytesIO()+ with wave.open(target, 'wb') as output:+ output.setparams((2, 2, rate, 0, 'NONE', 'not compressed'))+ output.writeframes(b''.join(chunks))+ return target.getvalue()+++def chain_first_sound(request, video_path=None):+ """Carry the opening sound unchanged; only the first part may supply it from its own file."""+ try:+ metadata = _snapshot_value(request)['metadata']+ if metadata.get('first_sound') is not None:+ unpack_first_sound(metadata['first_sound'])+ return metadata['first_sound']+ if metadata['chain']['segment'] != 1 or video_path is None:+ return None+ from .continuation_store import video_id+ if video_id(video_path) != request.get('source_id'):+ raise ValueError(MISSING)+ return pack_first_sound(first_sound_wav(video_path))+ except (ValueError, MemoryError):+ raise+ except Exception:+ raise ValueError('Invalid first sound') from None++def validate_path(video_path):path = Path(video_path)if not path.is_absolute() or path.suffix.lower() != '.mp4' or not path.is_file():@@ -375,13 +477,16 @@ class Prefix:update. Audio is either kept clean or re-noised at each call, and restoredon return. Only re-noising owns an independent RNG."""- def __init__(self, transformer, data, seed, device, *, video_offset=0):+ def __init__(self, transformer, data, seed, device, *, video_offset=0, audio_offset=0):import torchfrom diffusers.modular_pipelines.minimax_h3.before_denoise import patchify_video_latentsself.audio_context = validate_audio_context(data.get('audio_context', AUDIO_CONTEXT_DEFAULT))if type(video_offset) is not int or video_offset < 0:raise ValueError('Invalid continuation reference row offset')self.video_offset = video_offset+ if type(audio_offset) is not int or audio_offset < 0:+ raise ValueError('Invalid continuation reference row offset')+ self.audio_offset = audio_offsetself.video = data['video'].to(device=device, dtype=torch.float32)self.audio = data['audio'].to(device=device, dtype=torch.float32)if (self.video.ndim != 5 or self.video.shape[:3] != (1, transformer.config.in_channels, LATENT_FRAMES)@@ -400,18 +505,20 @@ class Prefix:import torchvideo, audio = kwargs['hidden_states'][0], kwargs['audio_hidden_states'][0]count, ticks = self.video_rows.shape[0], self.audio.shape[2]- if video.shape[0] <= self.video_offset + count or audio.shape[0] // 2 < ticks:+ generated = audio.shape[0] - self.audio_offset+ if video.shape[0] <= self.video_offset + count or generated // 2 < ticks:raise ValueError(MISSING)self.current_video = videoself.restore_video()- audio_rows = torch.cat([torch.arange(ticks, device=audio.device) + channel * (audio.shape[0] // 2)+ audio_rows = torch.cat([torch.arange(ticks, device=audio.device) + self.audio_offset + channel * (generated // 2)for channel in range(2)])row_times = kwargs['timestep'][kwargs['timestep_indices']].clone()if self.audio_context == 'clean':audio[audio_rows] = self.audio_rowsrow_times[kwargs['audio_indices'][audio_rows]] = CLEAN_Telse:- audio_t = row_times[kwargs['audio_indices'][0]]+ # The first generated row: a voice reference ahead of it stays clean.+ audio_t = row_times[kwargs['audio_indices'][self.audio_offset]]# scale_noise uses H3's clean-at-one convention, not a standard DDPM clock.audio[audio_rows] = self.scheduler.scale_noise(self.audio_rows, audio_t, self.noise)row_times[kwargs['video_indices'][self.video_offset:self.video_offset + count]] = CLEAN_T@@ -429,12 +536,13 @@ class Prefix:@contextmanager-def sampling(transformer, data, seed, device, *, video_offset=0):+def sampling(transformer, data, seed, device, *, video_offset=0, audio_offset=0):if data is None:yield Nonereturn# Keep the legacy constructor call identical for existing continuations.- prefix = Prefix(transformer, data, seed, device, **({'video_offset': video_offset} if video_offset else {}))+ prefix = Prefix(transformer, data, seed, device, **({'video_offset': video_offset} if video_offset else {}),+ **({'audio_offset': audio_offset} if audio_offset else {}))handle = transformer.register_forward_pre_hook(prefix.before, with_kwargs=True, prepend=True)try:yield prefixdiff --git a/freevideo_engine/generate.py b/freevideo_engine/generate.pyindex 47f7275..c581f6d 100644--- a/freevideo_engine/generate.py+++ b/freevideo_engine/generate.py@@ -8,6 +8,7 @@ share the exclusive GPU-work lock and monitor the actual compute process.import argparseimport jsonimport os+import refrom pathlib import Pathimport signalimport subprocess@@ -364,7 +365,7 @@ def _run(args):raise# A record of another version, other weights or another first-pass size.value = dict(encoded_continuation(continue_from, canvas),- **{key: value[key] for key in ('audio_context', 'source_video', 'anchor') if key in value})+ **{key: value[key] for key in ('audio_context', 'source_video', 'anchor', 'sound') if key in value})return freeze_continuation(value) if continuation_directory is not None else valueframes = getattr(args, 'frames', None)@@ -374,6 +375,8 @@ def _run(args):raise ValueError('--continue-anchor requires --continue-from')# Every part of a long video is asked alike; only a part that continues another can use it.first_frame = None+ voice_reference = (dict(requested=True, used=False, reason=None)+ if getattr(args, 'voice_reference', False) and continue_from is not None else None)if getattr(args, 'first_frame_reference', False) and continue_from is not None:if continue_anchor is not None:raise ValueError('Choose --first-frame-reference or --continue-anchor, not both')@@ -446,6 +449,20 @@ def _run(args):first_frame.update(used=True, width=picture_width, height=picture_height)if continue_anchor is not None:continuation['anchor'] = media['references'][0]+ if voice_reference is not None:+ from .prompt_vlm.rules import split_source+ if first_frame is not None:+ voice_reference['reason'] = 'first_frame'+ elif continue_anchor is not None:+ voice_reference['reason'] = 'anchor'+ elif args.conditioning:+ # Preencoded conditioning cannot take another reference.+ voice_reference['reason'] = 'conditioning'+ elif not args.prompt_file or not split_source(args.prompt_file.read_text(encoding='utf-8'))[2]:+ voice_reference['reason'] = 'no_lines'+ elif re.search(r'(?i)\b(?:sing|sings|singing|sang|sung|lyrics)\b|唱', args.prompt_file.read_text(encoding='utf-8')):+ # Quoted lyrics read as lines, but on music the opening sound did not hold steady.+ voice_reference['reason'] = 'singing'active_loras = [row for row in media.get('loras', []) if row['strength'] != 0]if media:inferred_task = task_for(media)@@ -531,6 +548,8 @@ def _run(args):report['continue_anchor'] = continuation['anchor']if first_frame is not None:report['first_frame_reference'] = first_frame+ if voice_reference is not None:+ report['voice_reference'] = voice_referencefrom .support_report import code_identity, write as write_debugreport['runtime_hardware'] = hardware.to_dict()report['runtime_code'] = code_identity()@@ -565,6 +584,31 @@ def _run(args):if args._lora_max_block_bytes or args._lora_root_bytes:profile.setdefault('policy', {})['lora_max_block_bytes'] = args._lora_max_block_bytesprofile['policy']['lora_root_bytes'] = args._lora_root_bytes+ if voice_reference is not None and voice_reference['reason'] is None:+ # Model identity, first-pass size and LoRA admission may have switched this+ # request to tail encoding. Decide only after those checks, before encoding media.+ if 'tail' in continuation:+ voice_reference['reason'] = 'source_predates'+ else:+ from .continuation import chain_first_sound, unpack_first_sound+ try:+ kept = chain_first_sound(continuation, continue_from)+ sound = unpack_first_sound(kept) if kept is not None else None+ except ValueError:+ sound = None+ if sound is None:+ voice_reference['reason'] = 'unreadable'+ else:+ path = destination.with_suffix('.first-sound.wav')+ path.write_bytes(sound)+ from .media_request import digest+ media = dict(media, version=1, references=[dict(kind='audio', path=str(path),+ sha256=digest(path), bytes=path.stat().st_size)])+ validate_route(task=getattr(args, 'task', None) or 't2va', sound=True, two_pass=two_pass,+ preview=preview, refine_from=getattr(args, 'refine_from', None), media=media)+ continuation['sound'] = media['references'][0]+ args.task = profile['engine']['task'] = task_for(media)+ voice_reference['used'] = Trueresource_identity = local_identity(hardware, args.cache)history = ResourceHistory(history_path())history.recover_pending()@@ -729,7 +773,8 @@ def _run(args):staged=bool(preview or refine_source))report['sampling_plan'] = sampling_planif continuation is not None:- validate_route(task=profile['engine'].get('task', 't2va'), anchor=continue_anchor is not None)+ validate_route(task=profile['engine'].get('task', 't2va'), anchor=continue_anchor is not None,+ **(dict(sound=True, media=media) if voice_reference and voice_reference['used'] else {}))continuation = usable_continuation(continuation, canvas,json.loads((args.cache / 'manifest.json').read_text(encoding='utf-8')), sampling_plan)if 'tail' in continuation:diff --git a/freevideo_engine/prompt_vlm/rules.py b/freevideo_engine/prompt_vlm/rules.pyindex 7b6c5ce..32d576b 100644--- a/freevideo_engine/prompt_vlm/rules.py+++ b/freevideo_engine/prompt_vlm/rules.py@@ -204,6 +204,15 @@ def spoken_lines(scene):return lines+def split_source(text):+ """Description, sound sections and spoken lines, using only the prompt's text."""+ sound = re.search(r'(?m)^[ \t]*overall_soundscape[ \t]*:', text)+ scene, soundscape = (text[:sound.start()], text[sound.start():]) if sound else (text, '')+ tagged = re.findall(r'<(?:d|en|zh|ja|ko|cn)>\s*(.*?)\s*</(?:d|en|zh|ja|ko|cn)>', scene, re.S)+ lines = [line for line in tagged if plain(line)] + spoken_lines(scene)+ return scene, soundscape, list(dict.fromkeys(lines))++def dialogue(text, scene):"""Turn the user's spoken lines that came back quoted into H3 dialogue, verbatim.diff --git a/freevideo_engine/runtime.py b/freevideo_engine/runtime.pyindex 64188b4..b8b929c 100644--- a/freevideo_engine/runtime.py+++ b/freevideo_engine/runtime.py@@ -550,7 +550,9 @@ class Engine:refining = initial_latents is not Noneif continuation is not None:from .continuation import validate_route- validate_route(task=self.task, anchor=bool(continuation.get('anchor')))+ # Audio references are admitted below, after inspecting the encoded modalities.+ if self.task != 'ref2va_audio':+ validate_route(task=self.task, anchor=bool(continuation.get('anchor')))if tuple(continuation['video'].shape[-2:]) != (height // 16, width // 16):from .continuation import SIZE_MISMATCHraise ValueError(SIZE_MISMATCH)@@ -584,7 +586,7 @@ class Engine:progress = SamplingProgress(active_steps, len(self.transformer.transformer_blocks),offset=progress_offset, total=progress_total)progress.start()- continuation_offset = 0+ continuation_offset = continuation_audio_offset = 0early_receipt = Nonecondition_schedule = Nonesampling_kwargs = {}@@ -616,12 +618,18 @@ class Engine:sampling_kwargs.update(condition_schedule=condition_schedule, condition_trace=early_receipt['steps'])conditions = value.get('references') or Noneif continuation is not None:- if conditions is None or len(conditions) != 1 or conditions[0]['kind'] != 'image' or conditions[0].get('audio_latent') is not None:+ sound = (not continuation.get('anchor') and self.task == 'ref2va_audio'+ and conditions is not None and len(conditions) == 1+ and conditions[0]['kind'] == 'audio' and conditions[0].get('audio_latent') is not None)+ if not sound and (conditions is None or len(conditions) != 1 or conditions[0]['kind'] != 'image' or conditions[0].get('audio_latent') is not None):raise ValueError('Continuation anchor requires exactly one image reference without audio')+ if sound:+ validate_route(task=self.task, sound=True, media=dict(references=conditions))# Ref2VA packs independent-size references before generated# video rows in both passes. Their latents do not need the# keyframe resize used by first/last-frame conditioning.continuation_offset = info['reference_video_tokens']+ continuation_audio_offset = info['reference_audio_tokens']prompt, tags = value['prompt_embeds'].to(self.device_backend.device, torch.bfloat16), value['text_token_tags']else:prompt, tags, conditions = load_prompt(str(conditioning), self.device_backend.device)@@ -821,7 +829,8 @@ class Engine:with progress.layers(self.transformer.transformer_blocks), self.device_backend.make_offloader(self.offload_layers, prefetch=self.prefetch, weight_source=self.stream_weight_source) as offloader, sampling(self.transformer, continuation, seed, self.device_backend.device,- **({'video_offset': continuation_offset} if continuation_offset else {})) as prefix, \+ **({'video_offset': continuation_offset} if continuation_offset else {}),+ **({'audio_offset': continuation_audio_offset} if continuation_audio_offset else {})) as prefix, \(watch.layers(self.transformer.transformer_blocks) if watch is not None else nullcontext()):latents, audio = generate_latents(self.transformer, prompt, tags, frames,self.steps, seed, self.device_backend.device, step_seconds=step_seconds,diff --git a/freevideo_engine/worker.py b/freevideo_engine/worker.pyindex 537c0c0..8cc52ea 100644--- a/freevideo_engine/worker.py+++ b/freevideo_engine/worker.py@@ -104,6 +104,8 @@ def generate(request, resident=None):# single-pass request does not.validate_route(task=request['engine_options'].get('task', 't2va'),anchor=bool(continuation.get('anchor')),+ **(dict(sound=True, media=dict(references=[continuation['sound']]))+ if continuation.get('sound') else {}),two_pass=bool(request.get('sampling_plan', {}).get('requested')),preview=request.get('preview', False), refine_from=request.get('resume_first_pass'))if isinstance(getattr(torch.version, 'hip', None), str):@@ -652,6 +654,16 @@ def generate(request, resident=None):'OutOfMemoryError', 'CancelledError', 'InterruptProcessingException'):raisemetrics['first_frame_kept'] = dict(saved=False, error=type(error).__name__)+ try:+ from .continuation import chain_first_sound+ sound = chain_first_sound(continuation, continuation.get('source_video'))+ if sound is not None:+ continuation_data['metadata']['first_sound'] = sound+ except Exception as error:+ if isinstance(error, MemoryError) or type(error).__name__ in (+ 'OutOfMemoryError', 'CancelledError', 'InterruptProcessingException'):+ raise+ metrics['first_sound_kept'] = dict(saved=False, error=type(error).__name__)try:from .continuation_store import save as save_continuationmetrics['continuation_store'] = dict(save_continuation(request['output'], continuation_data), saved=True)