Instructions to use Pika-Labs/Pika-H3-Flex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Pika-Labs/Pika-H3-Flex 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("Pika-Labs/Pika-H3-Flex") prompt = "Image 1 is the exact two players, outfits, frog mask, table-tennis table and drained pool: keep them exactly as in Image 1.\nA fast table-tennis rally, shot with exactly these camera moves:\n00:00–00:03 — top-down from directly overhead, as in Image 1, as the rally begins and the ball flicks back and forth.\n00:03–00:06 — a smooth crane straight down from overhead to table height, ending right beside the net as the ball zips across.\n00:06–00:09 — fast whip pans left and right following the ball across the net, from one player to the other.\n00:09–00:12 — a 180-degree orbit around the frog-masked player as she leaps and smashes the ball.\n00:12–00:15 — a low-angle dolly backward along the pool floor as the woman in the red tracksuit dives and misses; the frog raises both arms and does a little victory dance; the camera settles and holds.\nThe players, table and pool stay consistent and in the same place throughout. Photoreal 35mm film look, true colour, light natural grain, matching Image 1. SPEED IS CRITICAL: everything moves at normal real-time speed, like 24fps footage played back at 24fps - natural motion, NO slow motion.\nSound: the quick tock-tock of the ball, sneakers squeaking on concrete, the smash, a thud as she dives, echo in the empty pool, the frog's muffled cheer. Music: a funky, upbeat drum-and-bass groove." 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
- Local Apps Settings
- Draw Things
Commit History
4 days ago
-
Release Pika H3 Flex
0ddf55a