"""MiniMax H3 Character Swap LoRA — prompt + workflow demo. This Space does not load the H3 base weights. It builds the Ref2VA prompt and ComfyUI checklist from the published model card. """ from __future__ import annotations import gradio as gr LORA_REPO = "https://huggingface.co/akatz-ai/MiniMax-H3-Character-Swap-LoRA" LORA_FILE = "h3_character_swap_pro4500_1000.safetensors" DATASET = "https://huggingface.co/datasets/akatz-ai/H3-Character-Swap-v1" BASE = "https://huggingface.co/Comfy-Org/MiniMax-H3" DEFAULT_TARGET = "the man in the purple shirt" DEFAULT_KEEP = ( "Keep the replacement character's identity, outfit, and art style from . " "Preserve the source video's camera, background, lighting, objects, and all other people. " "Match the target person's position, scale, pose, and movement. " "Do not show the reference sheet or its background." ) SHORT_CAPTION = ( "Swap {target} in