[feat] Align multimodal OpenAI serving APIs (#1781)
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# OpenAI-compatible serving examples
|
||||
|
||||
The REST serving engine is model-agnostic. Any model supported by
|
||||
`VideoGenerator` can use the same `/v1/models`, `/v1/videos`, and `/v1/images`
|
||||
surface; the two configs here are FastH3 validation profiles.
|
||||
|
||||
Launch the full FastH3 checkpoint:
|
||||
|
||||
```bash
|
||||
fastvideo serve --config examples/serving/openai_fasth3.yaml
|
||||
```
|
||||
|
||||
Launch the dense FastH3 LoRA on the base MiniMax-H3 checkpoint:
|
||||
|
||||
```bash
|
||||
adapter_path="$(hf download \
|
||||
FastVideo/FastVideo-FastH3-4-step-Preview-v1-LoRA \
|
||||
dense-datafree/adapter_model.safetensors)"
|
||||
|
||||
fastvideo serve --config examples/serving/openai_fasth3_lora.yaml \
|
||||
--generator.pipeline.components.lora_path "$adapter_path"
|
||||
```
|
||||
|
||||
FastH3 adapters are hybrid startup patches: alongside low-rank factors they
|
||||
may contain dense deltas and a VSA compression-gate replacement. They must be
|
||||
selected when the server starts. A request may carry the vLLM-Omni `lora`
|
||||
selector, but its name, path, and scale must match that startup adapter. A VSA
|
||||
adapter also needs `attention_backend: VIDEO_SPARSE_ATTN_H3`, `VSA_sparsity`,
|
||||
and `VSA_tile_size` like the full-checkpoint config.
|
||||
|
||||
Submit and poll an asynchronous job:
|
||||
|
||||
```bash
|
||||
job_id="$(curl -sS http://localhost:8000/v1/videos \
|
||||
-H 'content-type: application/json' \
|
||||
-d '{"model":"fasth3","prompt":"A fox runs through fresh snow."}' \
|
||||
| jq -r .id)"
|
||||
|
||||
curl -sS "http://localhost:8000/v1/videos/$job_id"
|
||||
curl -o result.mp4 "http://localhost:8000/v1/videos/$job_id/content"
|
||||
```
|
||||
|
||||
For a blocking call, `POST /v1/videos/sync` returns the MP4 body directly.
|
||||
@@ -0,0 +1,49 @@
|
||||
# OpenAI-compatible FastH3 full-checkpoint server.
|
||||
generator:
|
||||
model_path: FastVideo/FastVideo-Minimax-FastH3-Preview-v0.2
|
||||
engine:
|
||||
num_gpus: 4
|
||||
use_fsdp_inference: false
|
||||
parallelism:
|
||||
tp_size: 1
|
||||
sp_size: 4
|
||||
offload:
|
||||
dit: false
|
||||
dit_layerwise: false
|
||||
text_encoder: true
|
||||
image_encoder: true
|
||||
vae: true
|
||||
pin_cpu_memory: true
|
||||
compile:
|
||||
enabled: false
|
||||
vae_enabled: false
|
||||
pipeline:
|
||||
workload_type: t2v
|
||||
experimental:
|
||||
attention_backend: VIDEO_SPARSE_ATTN_H3
|
||||
VSA_sparsity: 0.9
|
||||
VSA_tile_size: 64
|
||||
inference_torch_compile: false
|
||||
vae_parallel_decode: true
|
||||
vae_parallel_decode_strategy: gather
|
||||
|
||||
server:
|
||||
host: 0.0.0.0
|
||||
port: 8000
|
||||
output_dir: outputs/openai_fasth3
|
||||
served_model_name: fasth3
|
||||
|
||||
default_request:
|
||||
negative_prompt: ""
|
||||
sampling:
|
||||
height: 768
|
||||
width: 1344
|
||||
num_frames: 124
|
||||
fps: 24
|
||||
num_inference_steps: 5
|
||||
guidance_scale: 1.0
|
||||
batch_cfg: false
|
||||
seed: 1000
|
||||
output:
|
||||
return_frames: false
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# OpenAI-compatible FastH3 startup-LoRA server. Override lora_path at launch
|
||||
# with the exact file returned by `hf download`; see README.md.
|
||||
generator:
|
||||
model_path: MiniMaxAI/MiniMax-H3
|
||||
engine:
|
||||
num_gpus: 4
|
||||
use_fsdp_inference: false
|
||||
parallelism:
|
||||
tp_size: 1
|
||||
sp_size: 4
|
||||
offload:
|
||||
dit: false
|
||||
dit_layerwise: false
|
||||
text_encoder: true
|
||||
image_encoder: true
|
||||
vae: true
|
||||
pin_cpu_memory: true
|
||||
compile:
|
||||
enabled: false
|
||||
vae_enabled: false
|
||||
pipeline:
|
||||
workload_type: t2v
|
||||
components:
|
||||
lora_path: /path/to/adapter_model.safetensors
|
||||
lora_nickname: fasth3-dense-datafree
|
||||
lora_strength: 1.0
|
||||
experimental:
|
||||
attention_backend: FLASH_ATTN
|
||||
inference_torch_compile: false
|
||||
vae_parallel_decode: true
|
||||
vae_parallel_decode_strategy: gather
|
||||
|
||||
server:
|
||||
host: 0.0.0.0
|
||||
port: 8000
|
||||
output_dir: outputs/openai_fasth3_lora
|
||||
served_model_name: minimax-h3
|
||||
|
||||
default_request:
|
||||
negative_prompt: ""
|
||||
sampling:
|
||||
height: 768
|
||||
width: 1344
|
||||
num_frames: 124
|
||||
fps: 24
|
||||
num_inference_steps: 5
|
||||
guidance_scale: 1.0
|
||||
batch_cfg: false
|
||||
seed: 1000
|
||||
output:
|
||||
return_frames: false
|
||||
|
||||
Reference in New Issue
Block a user