Skip to content
/ Mobius Public

Mobius: Text to Seamless Looping Video Generation via Latent Shift

Notifications You must be signed in to change notification settings

YisuiTT/Mobius

Repository files navigation

Icon Mobius: Text to Seamless Looping Video Generation via Latent Shift

Xiuli Bi ยท Jianfei Yuan ยท Bo Liu ยท Yong Zhang ยท Xiaodong Cun ๐Ÿ“ช ยท Chi-Man Pun ยท Bin Xiao

arXiv Project Website

GIF 1 GIF 2

title

๐Ÿ”ฎ Latest Update

  • [17/3/2025] ๐Ÿš€๐Ÿš€๐Ÿš€ We released mobius code based on CogVideoX. We also released mobius-vc2 code based on VideoCrafter2 and more cases!
  • [27/2/2025] ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ We released the Mobius Paper. Mobius is a novel method to generate seamlessly looping videos from text descriptions directly without any user annotations.

๐Ÿ“Œ Installation Guide

๐Ÿ’ก 1. Clone our repository

git clone [email protected]:YisuiTT/Mobius.git
cd Mobius

โ˜€๏ธ 2. Start with CogVideoX

โš™๏ธ 2.1 Environment Setup

conda create -n mobius python=3.10
conda activate mobius

pip install -r requirements.txt

๐Ÿค— 2.2 Download the models from Hugging Face

Model Resolution Checkpoint
CogVideoX-5b 720x480 Hugging Face

๐Ÿš€ 2.3 Inference with CogVideoX

python mobius_cli_demo.py --prompts_path "./prompts/samples.txt" --model_path /path/to/your_models_path/CogVideoX-5b --output_path "./results/samples" --shift_skip 6 --frame_invariance_decoding

๐Ÿ’ŽParameter:

  • prompts_path(str): The path to the description of the video to generate.
  • model_path(str): The path of the pre-trained model to be used.
  • output_path(str): The path where the generated video will be saved.
  • shift_skip(int): Set the skip step of latent shift.
  • frame_invariance_decoding(bool): Enable or disable frame-invariance decoding.

๐Ÿ‘‘ 2.4 Run Gradio Demo

python gradio_web_demo.py

๐Ÿ’Tips:

Set the following environment variables in your system:

  • MODEL_PATH = your_models_path

๐ŸŒ‘ 3. Start with VideoCrafter2

โš™๏ธ 2.1 Environment Setup

conda create -n mobius_vc2 python=3.8.5
conda activate mobius_vc2

pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements_vc2.txt

๐Ÿค— 2.2 Download the models from Hugging Face

Model Resolution Checkpoint
VideoCrafter2 (Text2Video) 512x320 Hugging Face

๐Ÿš€ 2.3 Inference with VideoCrafter2

python mobius_vc2_demo.py --prompt_file "prompts/samples.txt" --ckpt_path /path/to/your_models_path/VideoCrafter2/model.ckpt --savedir "results_vc2/samples" --shift_skip 9

๐Ÿ’ŽParameter:

  • prompt_file(str): The path to the description of the video to generate.
  • ckpt_path(str): The path of the pre-trained model to be used.
  • savedir(str): The path where the generated video will be saved.
  • shift_skip(int): Set the skip step of latent shift.

๐ŸŽฌCogVideoX Gallery

๐Ÿงธ Animal

GIF 1 GIF 2 GIF 3

Prompt: A lone wolf stands atop a snowy hill, howling beneath a starry sky in a frozen forest...

Prompt: A majestic dragon soars through the sky, its massive wings outstretched against the fiery colors of a setting sun...

Prompt: A cat stretches lazily in the warm sunlight streaming through an open window, its fur glowing in the golden light...

๐Ÿงฉ Environment

GIF 1 GIF 2 GIF 3

Prompt: Small raindrops create rhythmic ripples in a puddle, their concentric circles merging seamlessly...

Prompt: White-capped waves roll forward and crash dramatically against jagged rocks, sending spray into the air...

Prompt: Stars twinkle in the vast expanse of space as a galaxy rotates slowly in the distance...

๐ŸŽ  Cartoon

GIF 1 GIF 2 GIF 3

Prompt: A mischievous raccoon sneaks through a pile of cartoonish leaves in a city park...

Prompt: A group of adorable animals, including a talking squirrel, a rabbit in glasses, and a wise owl,...

Prompt: A young wizard in a colorful purple robe waves a wand, creating sparkling cartoonish magic...

๐ŸŽจ Watercolor

GIF 1 GIF 2 GIF 3

Prompt: A horse gallops through a golden wheat field, its mane and tail flowing in the wind...

Prompt: A fox moves through the forest, its body sleek and agile as it glides over the ground...

Prompt: A child dances joyfully in an open field, her arms outstretched as she spins in circles...

๐Ÿฅฝ Cyberpunk

GIF 1 GIF 2 GIF 3

Prompt: A cyberpunk courier in a sleek, urban jumpsuit speeds through a glowing metropolis on a hoverbike,...

Prompt: A woman with bright neon hair dances in the middle of a crowded street, her body moving to the rhythm of the city...

Prompt: A cyberpunk smuggler leans over a glowing console inside their hovercraft, the heads-up display scanning cargo containers...

๐ŸŽฌVideoCrafter2 Gallery

๐Ÿง‘โ€๐Ÿš€ Human

GIF 1 GIF 2 GIF 3

Prompt: A rugged man in a sleek, insulated black ski jacket and matching ski pants glides effortlessly down a pristine,...

Prompt: A woman in a flowing, white sundress and sunglasses, her hair tousled by the sea breeze, runs along a golden sandy beach...

Prompt: A hacker, surrounded by holographic screens, works feverishly in a dimly lit, tech-heavy room. The digital interference...

๐Ÿงธ Animal

GIF 1 GIF 2 GIF 3

Prompt: A majestic dragon soars through the sky, its massive wings outstretched against the fiery colors of a setting sun...

Prompt: A small crab, its vibrant orange and red shell glistening under the soft aquarium lights, scuttles across the smooth,...

Prompt: A small bat, its wings delicately folded, hangs upside down from a tree branch in the dim light of the evening...

๐Ÿงฉ Environment

GIF 1 GIF 2 GIF 3

Prompt: Brilliant fireworks explode in the night sky, scattering trails of red, blue, and gold. The camera zooms in on...

Prompt: White-capped waves roll forward and crash dramatically against jagged rocks, sending spray into the air...

Prompt: Lights from a vibrant city skyline shimmer on a rippling waterfront, reflecting a kaleidoscope of colors...

๐Ÿ“‹ TODO

  • Release the paper.
  • Release the code based on CogVideoX-5b.
  • Release the code based on VideoCrafter2
  • Longer looping and RoPE-interp code.

๐Ÿ“Ž Citation

If you use this code for your research, please cite the following work:

@article{2025mobius,
    author    = {Bi, Xiuli and Yuan, Jianfei and Liu, Bo and Zhang, Yong and Cun, Xiaodong and Pen, Chi-Man and Xiao, Bin},
    title     = {Mobius: Text to Seamless Looping Video Generation via Latent Shift},
    booktitle = {arxiv},
    year      = {2025},

๐Ÿ“š Acknowledgements

The project is built based on the following repository:

Thanks to the authors for sharing their awesome codebases!

ยฉ๏ธ Licence

This work is licensed under a MIT License.

About

Mobius: Text to Seamless Looping Video Generation via Latent Shift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages