Papers › MAGREF: Masked Guidance for Any-Reference Video Generation

MAGREF: Masked Guidance for Any-Reference Video Generation

29 May 2025arXiv:2505.23742archive 2025-07-28

Yufan Deng, Xun Guo, Yuanyang Yin, Jacob Zhiyuan Fang, Yiding Yang, Yizhi Wang, Shenghai Yuan, Angtian Wang, Bo Liu, Haibin Huang, Chongyang Ma

Video generation has made substantial strides with the emergence of deep generative models, especially diffusion-based approaches. However, video generation based on multiple reference subjects still faces significant challenges in maintaining multi-subject consistency and ensuring high generation quality. In this paper, we propose MAGREF, a unified framework for any-reference video generation that introduces masked guidance to enable coherent multi-subject video synthesis conditioned on diverse reference images and a textual prompt. Specifically, we propose (1) a region-aware dynamic masking mechanism that enables a single model to flexibly handle various subject inference, including humans, objects, and backgrounds, without architectural changes, and (2) a pixel-wise channel concatenation mechanism that operates on the channel dimension to better preserve appearance features. Our model delivers state-of-the-art video generation quality, generalizing from single-subject training to complex multi-subject scenarios with coherent synthesis and precise control over individual subjects, outperforming existing open-source and commercial baselines. To facilitate evaluation, we also introduce a comprehensive multi-subject video benchmark. Extensive experiments demonstrate the effectiveness of our approach, paving the way for scalable, controllable, and high-fidelity multi-subject video synthesis. Code and model can be found at: https://github.com/MAGREF-Video/MAGREF

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 14 code samples harvested from 1 repository linked to this paper: 10 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 1 honoured, 2 violated, 2 with no contract checked; 5 where Syntology's instrument failed) · 4 unverified. Where Syntology's instrument failed: 4 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 14 samples from 1 repository, 10 ran (5 with no instrument failure; 5 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

magref-video/magref officialmentioned in papermentioned on GitHubpytorchApache-2.0Syntology: 14 samples, 10 ran (5 instrument-failed) · 4 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested: 10 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 1 honoured, 2 violated, 2 with no contract checked; 5 where Syntology's instrument failed) · 4 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
2ran · violated contract
4ran · our draft was wrong
1ran; the contract check could not run
2ran
4unverified

Licence: 5 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. For 5 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from magref-video/magref. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

magref-video/magref official repository 14 samples, 10 ran (5 instrument-failed) · 4 unverified
basic_clean in 217 papers magref/modules/tokenizers.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · 98f385d847636a3e · report fixture: signature text:str/0/str · returned str · level recorded 2026-09-22
canonicalize in 7 papers magref/modules/tokenizers.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · 1066f2140d4e9845 · report fixture: signature text:str/0/str, keep_punctuation_exact_string:NoneType/0/? · returned str · level recorded 2026-09-25
count_conv3d magref/modules/vae.py ran · honoured contract Apache-2.0 (permissive) here; the stored copy is pointer only · 78d2ce0959095290 · report fixture: signature model:callable/0/? · returned int · level recorded 2026-09-25
fp16_clamp in 8 papers magref/modules/t5.py ran · violated contract fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · d3d53f877a9af3a3 · report fixture: signature x:Tensor/1/float · returned Tensor · level recorded 2026-09-25
pad_freqs magref/distributed/xdit_context_parallel.py ran fingerprinted Apache-2.0 (permissive) · fc80adbc3ff1d836 · report fixture: signature original_tensor:Tensor/3/float, target_len:int/0/int · returned Tensor · level recorded 2026-09-25
rope_apply in 5 papers magref/modules/model.py ran · our draft was wrong Apache-2.0 (permissive) · 1d28c4a06c930d63 · report fixture: signature x:Tensor/4/float, grid_sizes:Tensor/2/int, freqs:Tensor/2/float · returned Tensor · level recorded 2026-09-22
rope_params in 5 papers magref/modules/model.py ran · violated contract fingerprinted Apache-2.0 (permissive) · dc160d63c5846f4a · report fixture: signature max_seq_len:int/0/int, dim:int/0/int, theta:int/0/int · returned Tensor · level recorded 2026-09-22
sinusoidal_embedding_1d in 5 papers magref/modules/model.py ran; the contract check could not run (RAISES) fingerprinted Apache-2.0 (permissive) · e34a97853e924d88 · report fixture: signature dim:int/0/int, position:Tensor/1/int · returned Tensor · level recorded 2026-09-22
whitespace_clean in 230 papers magref/modules/tokenizers.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · 9542161e9640b858 · report fixture: signature text:str/0/str · returned str · level recorded 2026-09-22
xlm_roberta_large magref/modules/xlm_roberta.py ran Apache-2.0 (permissive) · dd27a4bda5e8824c · report fixture: signature pretrained:bool/0/bool, return_tokenizer:bool/0/bool, device:str/0/str · returned XLMRoberta · level recorded 2026-09-25
flash_attention in 8 papers magref/modules/attention.py unverified Apache-2.0 (permissive) · 7ea44a4680b76539 · report
pos_interpolate magref/modules/clip.py unverified Apache-2.0 (permissive) · cbc3565ced3e12b6 · report
shard_model magref/distributed/fsdp.py unverified Apache-2.0 (permissive) · f0b4a00c14f06595 · report

Tasks

Human-Domain Subject-to-VideoOpen-Domain Subject-to-VideoSingle-Domain Subject-to-VideoVideo Generation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P Aesthetics 0.4502 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P FaceSim 0.3083 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P GmeScore 0.7047 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P Motion 0.2181 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P NaturalScore 0.6949 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P NexusScore 0.4304 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P Total Score 0.4793 #7 of 10 Archive leaderboard report
Open-Domain Subject-to-Video OpenS2V-Eval MAGREF-480P Venue Open-Source #7 of 10 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections