Run this model with HF Jobs

Run aptech0081/h3_ref_char_replace_v1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/aptech0081/h3_ref_char_replace_v1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/aptech0081/h3_ref_char_replace_v1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
aptech0081's picture
v1.1 LoRA (full + Frobenius 0.99 copy) and workflow; v1 moved to archive/
b634099 verified
|
Raw History Blame Contribute Delete
6.91 kB
metadata
license: other
license_name: minimax-h3-community-license-agreement
license_link: https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/LICENSE
language:
  - en
base_model:
  - MiniMaxAI/MiniMax-H3
pipeline_tag: text-to-video
tags:
  - comfyui
  - workflow
  - minimax-h3
  - lora
  - video
  - character-swap

H3 Character Swap LoRA v1.1

A LoRA for MiniMax H3 (ref2va) that replaces a person in a short video with the character from your reference pictures. The scene, camera, motion and sound follow the source video.

Download the workflow · Download the LoRA · Prompt node on GitHub

Sample, made with v1: the person in the source clip was replaced with a character from one reference picture (736x416, 5 seconds, 8 steps, seed 42). The character picture is 03_leila_archaeologist.png from H3 Character Sheet Creator.

Two people replaced at once, made with v1.1 and the workflow in this repository at its default settings (736x416, 5 seconds, 8 steps, seed 42). The source is the same street clip placed side by side with itself, so there is a man on the left and a man on the right. People to replace was two, with the man on the left and the man on the right, one picture per character (pictures 1 and 6). Both characters, 03_leila_archaeologist and 01_maya_travel_photographer, are fictional and come from H3 Character Sheet Creator.

Which file

File Size
h3_ref_char_replace_v1.1.safetensors 298 MB The full LoRA. The workflow loads this one.
h3_ref_char_replace_v1.1_fro99.safetensors 102 MB A smaller copy (Frobenius 0.99 rank reduction). It preserves the likeness, but it costs sharpness: the output is softer. Use it when file size matters more than detail.

The first release (v1 LoRA and its workflow) is in archive/.

About the training

The LoRA was trained on swap pairs that include actions the base H3 model does not account for. The sample above is ordinary footage.

  • Trigger word: ero_swap (the prompt node adds it for you)
  • Trained at 736x416, 24 fps, on 3, 5 and 10 second clips
  • 3 to 9 reference pictures per clip in training

Quick start

  1. Download the workflow above and drop it into ComfyUI.
  2. Put the model files in place (table below) and install the three custom node packs.
  3. Load 1 to 9 pictures of the new character. Bypass every Load Image you do not use.
  4. Pick the source video. It must have a stereo sound track.
  5. Choose the size and the length in seconds.
  6. In the prompt node, describe the new character in New character and pick what each picture is used for (face, hair, body, outfit, ...).
  7. Run.

More than one person in the video

  • One person is replaced, the others stay: list the people who stay in People who stay, and say where the person to replace is in Who they replace, for example the woman on the left, the woman in the foreground or the man on the right. The prompt then says Replace the woman on the left with <Subject 1>.
  • Two people are replaced: set People to replace to two. Describe the second character, give both a position (the woman on the left and the woman on the right, or the woman in the foreground and the woman in the background), and load the pictures by character: the first character's in pictures 1–5, the second's from picture 6 on (Their pictures start at moves that split). Two-person intro line is a short lead-in used only in this case; change its wording to fit your video.

Files

Custom nodes

  • H3 Character Swap Prompt: writes the prompt in the format the LoRA was trained on.
  • TARA-H3 (tested on v0.5.1): keeps the motion in time with the source video. The workflow uses its redistribute mode with 50% token drop, which needs sageattention and triton.
  • ComfyUI-VideoHelperSuite: loads the source video at 24 fps.

Everything else in the workflow is a core ComfyUI node. Tested on ComfyUI v0.43.

Settings to keep

  • euler + simple + 8 steps, shift 12 / 3, no CFG. The 8-step LoRA only works on this schedule.
  • Both LoRAs at strength 1.0.
  • Do not combine TARA's token drop with Model Sparse Attention.

Known limits

  • Stay near the trained size. With v1, at 960x544 and 5 seconds a test shot kept the original person for its first 2 seconds; 960x544 at 3 seconds and 736x416 at 5 seconds swapped every frame. If the original person shows up, lower the size or the length.
  • The workflow renders one clip in one pass. It has no upscaler and is not built for long videos.
  • The sound in the result is the model's copy of the source sound track, not the original track.

License

This LoRA follows the base model's license: the MiniMax H3 community license.