Instructions to use Ashmotv/H3-Style-Transfer-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Ashmotv/H3-Style-Transfer-LoRA with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("MiniMaxAI/MiniMax-H3", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Ashmotv/H3-Style-Transfer-LoRA") prompt = "Styl3_transf3r" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png") output = pipe(image=input_image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Inference
- Notebooks
- Google Colab
- Kaggle
H3 Style Transfer LoRA
A style-transfer LoRA for MiniMax H3 Ref2VA. Give it a style reference (an image or a video) and a plain content prompt, and it renders a new video of your content in the reference's style. The aim is to transfer the style, not the reference's subject.
Examples
Basketball
Firefighter
More styles
Files
| File | Trainer | Rank | Strength (alone) |
|---|---|---|---|
Style_transfer_DS_step1080.safetensors |
DiffSynth-Studio | 16 | 1.0 |
Style_transfer_v1.1_AIToolkit_step1600.safetensors |
AI-Toolkit 0.13.23 | 4 | 1.25β1.6 |
experimental/Style_transfer_merge_balanced.safetensors |
merge of the two above | 20 | 1.0 |
experimental/Style_transfer_merge_latetame2.safetensors |
merge of the two above | 20 | 1.0 |
Using both as a combo: stack the two LoRAs, with DS-1080 at 1.0 and v1.1-1600 at 0.75. (On its own, v1.1-1600 needs a higher strength, 1.25β1.6.)
About the experimental merges:
- Both are lossless rank concatenations of DS-1080 and v1.1-1600 (
B = [B_ds | B_v11],A = [w_dsΒ·A_ds ; w_v11Β·A_v11]), with per-layer weightsw_ds,w_v11. balanced: each LoRA contributes equal energy in every layer.latetame2: DS 1.0 / v1.1 0.5 in blocks 0β16; DS 0.6 / v1.1 0.9 in blocks 17β49.- Both have only been evaluated on a small internal test set. Treat them as experiments.
Usage (ComfyUI)
Node:
MiniMaxH3ReferenceToVideo, with your style reference connected as<Picture 1>.Loading the LoRA: use
LoraLoaderModelOnlyat the strengths above.Settings we used:
Setting Value Steps 28 Sampler / scheduler res_multistep/betaResolution 672Γ384, 73 frames ref_image_sizematchFewer steps weaken the style. In our tests, 8 steps weakened it compared with 28.
Disconnect unused reference inputs. A bypassed reference-video or reference-audio node can still pass its input through and act as a second reference. Disconnect any unused
ref_video/ref_audioinputs.
Prompt format
Use the trigger and the caption format the LoRA was trained on:
Styl3_transf3r, Use <Picture 1> as the exact style reference.
integrated_multimodal_description: [Shot 1] <shot type> captures <subject + action + environment>. <motion>. The camera <camera move>.
Example:
Styl3_transf3r, Use <Picture 1> as the exact style reference.
integrated_multimodal_description: [Shot 1] A wide shot captures a single horse galloping across an open grassy field toward a line of trees, its mane and tail streaming behind it. The horse moves from right to left across the frame. The camera pans to follow the horse.
Tip: add a short style description or a few style keywords to your prompt (for example "linocut print, bold black linework"). It grounds the model, and the LoRA works much better with it. (The training captions themselves described only the content.)
Training
Data
- Pairs: 420 image pairs plus 40 video pairs (the video pairs repeated Γ3). In each pair the reference and the target share a style but show a different subject and setting.
- Sources: Midjourney style references, Krea style and moodboard collections, and infographic styles. Up to 5 pairs per style. Every pair was hand-picked from about 2,000 candidates.
- Captions: the target's content only, in H3's shot format, with the trigger prefix. No style words.
DS-1080 recipe (DiffSynth-Studio)
- Base
minimax_h3_ref2va, with the DeCFG Ref2VA adapter as the preset LoRA - LoRA rank 16, AdamW, lr 1e-4
- Images at most 768Β² px; videos at 672Γ384, 73 frames; audio loss weight 0
- 540 samples per epoch, 2 epochs = 1,080 steps (about 10 s/step on an H100)
- Later checkpoints weren't better. On our test grid, 1080 and 1620 tied, and 1215β1485 did worse on linocut and B&W styles.
Notes from training and merging
- Pair design: each pair shares the style but differs in subject and environment. The intent is for the LoRA to learn "transfer the style" rather than "copy the reference".
- Where each trainer put its change: from weight analysis of the two files, DiffSynth concentrated its change in blocks 8β12 and AI-Toolkit in blocks 20β33. Both used only 1β3 effective directions per layer, even at rank 16.
- The two LoRAs are near-orthogonal (cosine β 0 per layer). That's why rank concatenation can merge them without either cancelling the other.
- Single-band edits: in our small merge tests, lowering DS weight in any single block band (17β23, 24β29, 30β39, 40β49) did not stop the reference's subject being copied. Lowering it in 24β29 or 30β39 made a graphic B&W style turn photographic.
- Community notes on H3 blocks (Banodoco): blocks 0β19 are associated with motion, and image-only LoRAs are often trained on blocks 20β49 to preserve motion. These are not our own measurements.
- Data gaps: physical materials (wood, clay, crochet) and pale thin line art were under-represented in the data.
Limitations
- Trained and evaluated on H3 Ref2VA only.
- Our evaluations used a small set of references and prompts, mostly at a single seed.
- It can sometimes copy shapes or patterns from the reference.
- Downloads last month
- -
Model tree for Ashmotv/H3-Style-Transfer-LoRA
Base model
MiniMaxAI/MiniMax-H3