Instructions to use akatz-ai/MiniMax-H3-Character-Swap-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use akatz-ai/MiniMax-H3-Character-Swap-LoRA with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Updated workflow with H3 Relay v2.0 & v1.5 Lora and Comfyui V0.42.1
Just to disable The masking, Lora strength 1.5,
H3-Relay 2.0 + v1.5 lora + Comfyui v0.42.1
H3-Character-Swap-Relay-V2.json
promt use this:
Replace the person in <Video 1> with the character shown in <Picture 1>.
subject_definitions:
<Subject 1> is the replacement character whose appearance comes from <Picture 1> and whose performance comes from the person being replaced in <Video 1>. Preserve the reference character's facial features, hairstyle, skin tone, body proportions, clothing, colors, and distinctive visual style. The reference image supplies appearance only, not the character's pose, expression, background, or framing.
<Subject 2> is the surrounding scene from <Video 1>, including its background, lighting, objects, and any people other than the person being replaced.
<Video 1> is the source video being edited and supplies the shot composition, camera movement, timing, and sequence of actions.
summary:
[video editing + reference generation] The target video is an edited version of <Video 1>. Replace the original person with <Subject 1>, transferring their complete visible performance to the reference character while preserving <Subject 2> and the source video's framing and timing.
retention_analysis:
<Subject 1> (throughout [Shot 1]): fully_preserved - maintain the character's referenced identity, clothing, proportions, and visual style consistently as the character performs the source person's movements.
<Subject 2> (throughout [Shot 1]): fully_preserved - retain the surrounding scene and its changes over time.
<Video 1>: partially_preserved - retain composition, camera motion, action timing, and duration; replace only the selected person's appearance.
detailed_description:
Preserve the source scene's visual treatment while retaining the replacement character's distinctive design. Adapt illumination, shading, and perspective to the source scene.
[Shot 1] Begin with the same composition and camera viewpoint as <Video 1>. <Subject 1> occupies the original person's position and follows their movement through the frame. Match the original performance moment by moment: body posture, gestures, head turns, gaze, blinking, facial expressions, and visible mouth movements.
Maintain the reference character's identity through every expression and viewing angle. Hair and clothing move naturally with the transferred performance. Preserve interactions with source-scene objects and the ordering of foreground and background occlusions.
Keep the source video's crop and shot scale. Show only the portions of the replacement character that belong within that framing; do not widen the shot to reproduce the full-body reference. Do not import the reference image's background, static pose, or handheld props. Preserve the source camera movement and action timing through the final frame.
overall_soundscape:
Retain the source clip's existing sound without adding new dialogue or sound effects.
non_diegetic_music:
Retain existing source music, if present; add no new music.
no matter what I try on v2 workflow it’s the same error in every run on Native loop · one H3 window node so tensor resolution mismatch or something can you screenshot what you have for that node?
no matter what I try on v2 workflow it’s the same error in every run on Native loop · one H3 window node so tensor resolution mismatch or something can you screenshot what you have for that node?
do not install h3-relay from comfyui, it's will crash with your sol-attn,
just download the code from https://github.com/akatz-ai/h3-relay
then copy the folder into custom node
Hi @imbiplaza ! Thank you so much for creating this amazing LoRA. I'm also getting the error that reports @Tamilboy1 on the "Native loop one H3" node after installing it as a custom node with git clone and restarting ComfyUI (version 0.42.3). As soon as the workflow reaches the sampler node, it crashes with this error:
File "C:...\ComfyUI_windows_portable\ComfyUI\comfy\ldm\minimax\model.py", line 621, in forward
graph_out = comfy.patcher_extension.WrapperExecutor.new_class_executor(
...<2 lines>...
comfy.patcher_extension.get_all_wrappers(comfy.patcher_extension.WrappersMP.DIFFUSION_MODEL, transformer_options)
).execute(x, timestep, context, transformer_options, minimax_payload=minimax_payload,
denoise_mask=denoise_mask, audio_denoise_mask=audio_denoise_mask, **kwargs)
File "C:...\ComfyUI_windows_portable_nvidia\v4\ComfyUI_windows_portable\ComfyUI\comfy\patcher_extension.py", line 113, in execute
return self.original(*args, **kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:...\ComfyUI_windows_portable_nvidia\v4\ComfyUI_windows_portable\ComfyUI\comfy\ldm\minimax\model.py", line 739, in _forward
h = self._embed_and_pack(video_x, audio_x, context, layout, payload, transformer_options)
File "C:...\ComfyUI_windows_portable_nvidia\v4\ComfyUI_windows_portable\ComfyUI\comfy\ldm\minimax\model.py", line 579, in _embed_and_pack
all_audio_rows[~audio_update] = cond_audio_rows
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
RuntimeError: shape mismatch: value tensor of shape [412, 32] cannot be broadcast to indexing result of shape [824, 32]
It seems like an audio-related issue but I might be wrong. I tried different videos with different length, audio and frame rate always with the same result. The lora works good with the default workflow in ComfyUI tho, although I'd like to use yours as it'll probably be much better.
Edit: ComfyUI version
Hi @jkingcis
Thanks for the detailed trace. Could you share:
Your workflow JSON and the full console log from a fresh ComfyUI startup through the error?
Whether it fails on the first window or after one window finishes?
Your H3 Relay version or commit, plus the selected H3 model, audio VAE, and LoRA filenames?
Which default workflow works for you, and whether you tested it with the same source video, reference, and models?
Do you also have minimax-h3-extend or any standalone H3 Motion Context packs installed? We found a layout conflict involving those in another setup, and I’d like to check whether yours has the same conflict before assuming the audio error has the same cause.
