> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-zh/shi-pin-sheng-cheng/cubecomposer-360-video.md).

# CubeComposer 4K 360° 视频

> **CubeComposer** （CVPR 2026）是一个时空自回归扩散模型，可生成 **原生 4K 360° 全景视频** 基于标准透视视频输入。建立在 Wan 视频基础模型之上，使用 11,832 段高分辨率片段训练。这是首个能够原生生成 4K 360° 的开源模型——可在消费级 GPU 硬件上实现 VR 内容创作、虚拟导览和沉浸式媒体制作。

## 为什么这很重要

传统上，360° 视频需要专门的拍摄设备（多摄像头、拼接软件、昂贵的后期处理）。CubeComposer 改变了这一点：

* **输入**：任何标准相机视频（单镜头、手机摄像头、行车记录仪）
* **输出**：原生 4K 360° 等距矩形视频
* **方法**：将全景拆分为立方体贴图各面，以空间一致性的方式自回归生成每个面
* **质量**：显著优于以往的拼接和外绘方法

## 硬件要求

| 配置            | 显存   | 分辨率            | 速度         |
| ------------- | ---- | -------------- | ---------- |
| RTX 4090 24GB | 24GB | 4K 360°（30 帧）  | 约 8 分钟/片段  |
| RTX 5090 32GB | 32GB | 4K 360°（60 帧）  | 约 6 分钟/片段  |
| 2× RTX 4090   | 48GB | 4K 360°（120 帧） | 约 9 分钟/片段  |
| A100 80GB     | 80GB | 4K 360°（240 帧） | 约 12 分钟/片段 |

**最低**：RTX 4090 24GB（或等效 24GB+ VRAM GPU）

> 在 Clore.ai 上：RTX 4090 起价 **$0.14–0.42/小时 现货价** —— 2 分钟片段成本约 $0.40。

## 安装

```bash
# 克隆仓库
git clone https://github.com/TencentARC/CubeComposer
cd cubecomposer

# 安装依赖（Python 3.10+，CUDA 12.8+）
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt

# 下载模型权重（约 18GB）
python scripts/download_weights.py --model cubecomposer-4k-v1
```

### Docker（推荐用于 Clore.ai）

```bash
# 没有官方 Docker 镜像——请从源码安装：
git clone https://github.com/TencentARC/CubeComposer /workspace/CubeComposer
cd /workspace/CubeComposer
pip install -r requirements.txt
python app.py --share --listen 0.0.0.0 --port 7860
```

## 快速开始

### CLI：透视视频 → 4K 360°

```bash
# 基本用法：输入透视视频，输出 4K 等距矩形视频
python generate_360.py \
  --input /workspace/input_video.mp4 \
  --output /workspace/output_360.mp4 \
  --resolution 4096x2048 \
  --frames 30 \
  --fps 30

# 更高质量：更多步数，更长片段
python generate_360.py \
  --input /workspace/walk_through_park.mp4 \
  --output /workspace/park_360_4k.mp4 \
  --resolution 4096x2048 \
  --frames 60 \
  --num_inference_steps 50 \
  --guidance_scale 7.5 \
  --fps 30
```

### Python API

```python
from cubecomposer import CubeComposerPipeline
import torch

# 加载管道
pipe = CubeComposerPipeline.from_pretrained(
    "cubecomposer/cubecomposer-4k-v1",
    torch_dtype=torch.bfloat16
).to("cuda")

# 从透视输入生成 360° 视频
output = pipe(
    input_video_path="input.mp4",
    num_frames=30,
    resolution=(4096, 2048),  # 4K 等距矩形
    num_inference_steps=50,
    guidance_scale=7.5,
    cubemap_size=1024  # 每个立方体贴图面的尺寸
)

# 保存为标准等距矩形 MP4
output.save("output_360.mp4", fps=30)
print(f"已生成 4K 360° 视频：output_360.mp4")
```

### Gradio WebUI

```python
import gradio as gr
from cubecomposer import CubeComposerPipeline
import torch

pipe = CubeComposerPipeline.from_pretrained(
    "cubecomposer/cubecomposer-4k-v1",
    torch_dtype=torch.bfloat16
).to("cuda")

def generate_360(video, frames, steps):
    output = pipe(
        input_video_path=video,
        num_frames=int(frames),
        resolution=(4096, 2048),
        num_inference_steps=int(steps)
    )
    output.save("/tmp/output_360.mp4", fps=30)
    return "/tmp/output_360.mp4"

demo = gr.Interface(
    fn=generate_360,
    inputs=[
        gr.Video(label="输入透视视频"),
        gr.Slider(10, 120, value=30, label="帧数"),
        gr.Slider(20, 80, value=50, label="推理步数（质量）")
    ],
    outputs=gr.Video(label="4K 360° 输出"),
    title="CubeComposer — 4K 360° 视频生成",
    description="上传任意透视视频 → 获得原生 4K 360° 全景视频"
)

demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
```

## 在 Clore.ai 上部署：分步指南

### 1. 租用一张 RTX 4090

1. 前往 [clore.ai/marketplace](https://clore.ai/marketplace)
2. 筛选：GPU， **24GB+ VRAM** （推荐 RTX 4090）
3. 现货价格：约 $1.20–2.50/小时，视可用性而定
4. 选择 **自定义 Docker** 或 **Ubuntu** 镜像

### 2. 通过 SSH 设置

```bash
# 连接到你的 Clore 服务器
ssh root@<server-ip>

# 一行命令完成设置
git clone https://github.com/TencentARC/CubeComposer && \
  cd cubecomposer && \
  pip install -r requirements.txt && \
  python scripts/download_weights.py && \
  python app.py --port 7860 --host 0.0.0.0
```

### 3. 访问 UI

打开 `http://<server-ip>:7860` 在浏览器中使用 Gradio 界面。

## 工作流：手机视频 → 可用于 VR 的 4K 360°

```bash
# 第 1 步：将手机视频上传到服务器
scp ~/my_video.mp4 root@<server-ip>:/workspace/

# 第 2 步：生成 4K 360° 版本
ssh root@<server-ip> "cd cubecomposer && python generate_360.py \
  --input /workspace/my_video.mp4 \
  --output /workspace/my_video_360_4k.mp4 \
  --resolution 4096x2048 --frames 60"

# 第 3 步：为 YouTube/VR 头显添加 360° 元数据
ffmpeg -i my_video_360_4k.mp4 \
  -c copy \
  -metadata:s:v:0 spherical=equirectangular \
  my_video_360_4k_vr.mp4

# 第 4 步：下载结果
scp root@<server-ip>:/workspace/my_video_360_4k_vr.mp4 ~/
```

## Spectrum 集成：在 Wan2.1 上提速 4.79×

该 **Spectrum 加速器** （CVPR 2026）——一种使用切比雪夫多项式、无需训练的谱扩散特征预测器——可应用于 CubeComposer 底层的 Wan2.1 基座，实现显著提速：

```python
from cubecomposer import CubeComposerPipeline
from spectrum_accelerator import SpectrumAccelerator
import torch

pipe = CubeComposerPipeline.from_pretrained(
    "cubecomposer/cubecomposer-4k-v1",
    torch_dtype=torch.bfloat16
).to("cuda")

# 应用 Spectrum，在不损失质量的情况下实现 4.79× 加速
accelerator = SpectrumAccelerator(pipe.unet, order=8)  # 切比雪夫阶数
pipe.unet = accelerator

# 现在生成速度约为原来的 4.79×
output = pipe(
    input_video_path="input.mp4",
    num_frames=30,
    resolution=(4096, 2048),
    num_inference_steps=50  # 约等效于 240 步的质量
)
output.save("output_fast_360.mp4")
```

## 质量提示

1. **输入视频质量很重要** —— 输入分辨率越高，360° 输出越好
2. **稳定的画面** —— 手持抖动会降低各个立方体贴图面之间的一致性
3. **光线良好** —— 避免极端对比（过曝天空 + 黑暗室内）
4. **更长的片段** —— 30+ 帧可获得更好的时间一致性
5. **面分辨率** — `--cubemap_size 1024` 是最佳选择（关键工作可用 2048，但会多消耗 4 倍 VRAM）

## 应用场景

* **VR 内容创作** —— 将任意素材转换为适用于 Meta Quest、Apple Vision Pro 的格式
* **虚拟房产导览** —— 将看房视频变成 360° 导览
* **旅行内容** —— 分享沉浸式旅行体验
* **建筑可视化** —— 360° 室内/室外漫游
* **活动记录** —— 将活动录制转换为沉浸式回放
* **游戏素材** —— 生成 360° 环境参考

## 生产流程成本估算

| 任务                 | Clore.ai 成本           |
| ------------------ | --------------------- |
| 5 秒片段（30 帧，4K）     | 约 $0.30（RTX 4090 现货价） |
| 10 秒片段（60 帧，4K）    | \~$0.50               |
| 30 秒片段（180 帧，4K）   | \~$1.20               |
| 批量：100 个片段（每个 5 秒） | \~$30                 |

## 相关指南

* [Wan2.1 视频生成](/guides/guides_v2-zh/shi-pin-sheng-cheng/wan-video.md) —— CubeComposer 所基于的基础模型
* [FramePack](/guides/guides_v2-zh/shi-pin-sheng-cheng/framepack.md) —— 高效长视频生成（6GB VRAM！）
* [LTX-2 视频](/guides/guides_v2-zh/shi-pin-sheng-cheng/ltx-video-2.md) —— 快速潜空间视频生成
* [ComfyUI](/guides/guides_v2-zh/tu-xiang-sheng-cheng/comfyui.md) —— 基于节点的视频 + 图像工作流
* [RIFE 视频插帧](/guides/guides_v2-zh/shi-pin-chu-li/rife-interpolation.md) —— 让生成的视频更平滑

***

*最后更新：2026 年 3 月 16 日 | 论文：arXiv:2603.04291（CVPR 2026）| 基于 Wan2.1 基础模型*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-zh/shi-pin-sheng-cheng/cubecomposer-360-video.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
