NVIDIA Cosmos 3 を GPU 1 台で試す:画像認識・微調整・動画生成を約 0.6 ドルで

NVIDIA の「Cosmos」は、ロボットや自動運転などの「物理 AI」に向けた基盤モデル群です。画像や動画を理解して文章で答えたり、1 枚の画像から「この先どう動くか」を動画として生成したりできます。

名前は聞くものの、大きな GPU が何台も必要そうで手を出しにくい、という方も多いのではないでしょうか。この記事では、最新の Cosmos 3 のうちいちばん小さい Cosmos3-Edge を、GPU クラウド「NVIDIA Brev」の GPU 1 台で動かし、次の 3 つを試した結果をまとめます。

  • ① 画像を認識する(推論)
  • ② 微調整(ファインチューニング)する
  • ③ 次の動きを予測した動画を作る

かかった時間は約 50 分、費用は約 0.6 ドルでした。うまくいかなかった点も、そのまま載せています。

検証した環境

項目 内容
検証日 2026 年 11 月 19 日
モデル Cosmos3-Edge(4B)/ Cosmos-Reason2-2B(微調整用)
GPU インスタンス NVIDIA RTX A6000(48GB)× 1、6 vCPU、メモリ 48GB、ディスク 256GB(Brev の massedcompute_A6000)
料金 0.68 ドル/時(ディスク込み)
手元の環境 macOS、Brev CLI v0.6.337

料金やバージョンは検証時点のものです。試すときは、最新の情報を公式のページで確認してください。

Cosmos 3 とは

Cosmos 3 は 2026 年 5 月に発表されたモデルで、1 つのモデルの中に 2 つの「塔」を持ちます。

  • Reasoner(理解):画像・動画・文章を読み、文章で答える VLM(視覚言語モデル)
  • Generator(生成):画像や文章から、その先の動画(や行動)を作る拡散モデル

大きさは Edge(4B)・Nano(16B)・Super(64B)の 3 種類です。今回は、いちばん小さい Edge を使いました。

どのモデルを使うか、なぜ GPU 1 台なのか

今回は「予算 5 ドル以内・GPU 1 台」という条件を先に決め、公式の資料を調べて、できることを選びました。

やりたいこと 公式に書かれていること 今回の選択
推論(理解・生成) Cosmos3-Edge は RTX PRO 6000・Jetson などで動く。Ampere・Hopper・Blackwell 世代に対応。必要なメモリの数値は書かれていない Cosmos3-Edge を RTX A6000(Ampere、48GB)で動かす。実際は 12.4GB で足りた
Cosmos 3 の微調整 公式のレシピは、Nano が H100 × 8、Edge が GPU 4 枚。GPU 1 枚の手順はない 行わない(予算と GPU 1 台に収まらない)
GPU 1 台でできる微調整 前の世代の Cosmos-Reason2-2B に、QLoRA の公式ノートブックがある。なお、Reason2 は開発が終了しており、今後は限られた保守のみ これを使い、Cosmos 系の Reasoner を微調整する流れを体験する

インスタンスの型は、Brev CLI の brev search gpu --sort price で選びました。最安の A6000(0.60 ドル/時)はディスクが 100GB しかありません。今回は合計 79GB を使ったので、ディスク 256GB の型(0.68 ドル/時)にして正解でした。

Brev の Create Environment 画面。左に GPU の種類、右に選んだ GPU の構成と最安料金
Brev の GPU 選択画面。GPU の種類を選ぶと、事業者ごとの候補が料金の安い順に並びます(画面は L40S を選んだ例)。CLI の brev search gpu でも同じ情報を見られます。

全体の流れ

やること 使うもの 結果(RTX A6000 48GB)
起動(課金開始) brev create cosmos-box --type massedcompute_A6000 約 8 分で使える状態
① 画像を認識する 公式の vLLM コンテナ + Cosmos3-Edge。OpenAI 互換 API に画像を送る サーバーの起動 約 4 分、1 回の答えは 0.4〜4 秒
② 微調整する cosmos-reason2 の公式 trl_sft.py(Reason2-2B を QLoRA) 10 ステップ 92 秒、GPU メモリ最大 11.6GB
③ 次の動きの動画を作る Diffusers の Cosmos3OmniPipeline(画像 → 動画) 832×480・121 フレームを 73〜109 秒、GPU メモリ最大 12.4GB
終了(必須) brev delete cosmos-box 約 1 分で一覧から消えた

Cosmos には Isaac Sim のような操作画面がないため、操作はすべて SSH でのコマンド実行です。

1. 起動する(ここから課金)

注意:ここから先は、GPU の料金が時間単位でかかります。使い終わったら、必ず 6 章の手順で削除してください。

$ brev create cosmos-box --type massedcompute_A6000 --detached
[Worker 1] massedcompute_A6000 Success! Created instance 'cosmos-box'

# 消し忘れ防止:3 時間後に自動で削除(費用の上限は約 2 ドル)
$ nohup sh -c 'sleep 10800; brev delete cosmos-box' &

作成から約 8 分で brev ls の表示が RUNNING / COMPLETED / READY になり、ssh cosmos-box で入れるようになりました。nvidia-smi で確認すると RTX A6000(48GB)が見え、Docker と Python 3.10 は最初から入っていました。

この型は「停止」ができず、削除しかできません。使い終わったら削除します。

準備(共通)

# インスタンスの中で
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install "huggingface_hub[cli]"
hf auth login            # Hugging Face のトークン(Read 権限)を入力
sudo apt-get install -y ffmpeg git-lfs

先に済ませておくこと:次の 2 つのモデルは、Hugging Face のページで利用条件への同意が必要です。同意していないと Access denied … requires approval で止まります。同意はブラウザで本人が行うので、課金が始まる前に済ませておくと、待ち時間の課金を減らせます。

・nvidia/Cosmos-1.0-Guardrail(動画生成の安全チェックに使う)
・nvidia/Cosmos-Reason2-2B(微調整に使う)

Cosmos3-Edge 本体は、同意なしで取得できました(ライセンスは OpenMDW 1.1)。利用条件は、各モデルのページで確認してください。

2. ① 画像を認識する(Cosmos3-Edge の Reasoner)

公式の vLLM コンテナ(約 19GB)でサーバーを立て、OpenAI 互換 API に画像と質問を送ります。GPU メモリ 48GB に合わせて、--max-model-len は 16384 にしました(公式の例は 131072)。

docker pull vllm/vllm-openai:cosmos3      # 約 6 分
docker run -d --name reasoner --gpus all --ipc=host -p 8000:8000 \
  -v $HOME/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:cosmos3 nvidia/Cosmos3-Edge \
  --host 0.0.0.0 --port 8000 --max-model-len 16384 \
  --mm-processor-kwargs '{"do_resize": true, "min_pixels": 4096, "max_pixels": 16777216}'
# 約 4 分で "Application startup complete." が出る(重みは約 4.7GB)

入力には、モデルのリポジトリにある公式のサンプル画像を使いました。

白いロボットアームと木の机。机の左に赤い花、右に青・赤・クリーム色の花瓶が並ぶ
入力画像(Cosmos3-Edge のモデルリポジトリにある公式サンプル assets/example_reasoning_input.png)。

質問は、標準ライブラリだけの短い Python スクリプトから送りました。

質問を送るスクリプト(reason_client.py)
#!/usr/bin/env python3
"""Ask Cosmos3-Edge Reasoner (vLLM OpenAI API) about an image. stdlib only.
usage: reason_client.py IMAGE OUT.json
"""
import base64, json, sys, time, urllib.request

URL = "http://localhost:8000/v1"
img, out = sys.argv[1], sys.argv[2]
mime = "image/png" if img.endswith(".png") else "image/jpeg"
b64 = base64.b64encode(open(img, "rb").read()).decode()

model = json.load(urllib.request.urlopen(URL + "/models"))["data"][0]["id"]
QUESTIONS = [
    ("describe", "Describe this image in detail. List the objects on the table and their colors.", False),
    ("locate", "Where is the flower relative to the red bottle? Answer with left/right/front/behind and an approximate distance.", False),
    ("plan", "The task is to put flower into the red bottle. Generate a plan consisting of subtasks for accomplish the task.", False),
    ("plan_thinking", "The task is to put flower into the red bottle. Generate a plan consisting of subtasks for accomplish the task.", True),
]
results = []
for key, q, think in QUESTIONS:
    body = {
        "model": model,
        "messages": [{"role": "user", "content": [
            {"type": "image_url", "image_url": {"url": f"data:{mime};base64,{b64}"}},
            {"type": "text", "text": q}]}],
        "max_tokens": 2048,
        "temperature": 0,   # 後述のとおり、計画の質問ではこの指定を外すこと
        "chat_template_kwargs": {"enable_thinking": think},
    }
    req = urllib.request.Request(URL + "/chat/completions", data=json.dumps(body).encode(),
                                 headers={"Content-Type": "application/json"})
    t0 = time.time()
    r = json.load(urllib.request.urlopen(req, timeout=600))
    dt = time.time() - t0
    msg = r["choices"][0]["message"]
    ans = msg.get("content") or ""
    reasoning = msg.get("reasoning_content") or msg.get("reasoning") or ""
    usage = r.get("usage", {})
    print(f"\n=== [{key}] thinking={think}  {dt:.1f}s  tokens(out)={usage.get('completion_tokens')}")
    print(f"Q: {q}")
    if reasoning:
        print(f"(thinking) {reasoning[:600]}{' ...' if len(reasoning) > 600 else ''}")
    print(f"A: {ans}")
    results.append({"key": key, "thinking": think, "question": q, "answer": ans,
                    "reasoning": reasoning, "seconds": round(dt, 2), "usage": usage})
json.dump({"model": model, "image": img, "results": results}, open(out, "w"), ensure_ascii=False, indent=2)
print(f"\nsaved {out}")

結果

質問(下は実際に送ったプロンプト) 答え(要約) 時間
画像を詳しく説明して
Describe this image in detail. List the objects on the table and their colors.
木の机、青・赤・薄い黄色の花瓶、緑の茎の赤い花、カメラ付きの白いロボットアーム。正確 0.97 秒
花は赤い瓶のどちら側?
Where is the flower relative to the red bottle? Answer with left/right/front/behind and an approximate distance.
「left of」だけ(正しいが、距離には答えなかった) 0.06 秒
花を赤い瓶に入れる計画(temperature=0)
The task is to put flower into the red bottle. Generate a plan consisting of subtasks for accomplish the task.
(公式サンプルのプロンプトと同じ文)
同じ手順を繰り返し、2048 トークンの上限まで止まらなかった(画像にない「緑の花瓶」まで出てきた) 13 秒
同じ計画の質問(temperature を指定しない=公式の既定) 腕を花の上へ → 下ろしてつかむ → 赤い瓶の上へ → 放す。正確 0.41 秒
同じ計画の質問(考える機能 enable_thinking あり) 考えた過程を書いたあと、8 段階の計画。正確 3.6 秒

既定の設定で返ってきた計画は、次のとおりです。

First, move the robot arm to a position above the red flower. Then, lower the gripper to grasp the red flower.
After successfully picking up the flower, move the robot arm to a position above the red bottle.
Finally, release the red flower into the red bottle.

つまずいたところ:temperature=0(毎回同じ答えにする設定)にすると、計画の質問で同じ行を繰り返しました。公式の generation_config.json は do_sample: true です。サンプリングは既定のままにしておくのがよさそうです。

次の手順に進む前に、サーバーを止めます。vLLM は GPU メモリの約 92% を先に確保するため、動かしたままでは ②③ を実行できません。

docker stop reasoner

3. ② 微調整する(Cosmos-Reason2-2B の QLoRA)

cosmos-reason2 のリポジトリにある公式の trl_sft.py を、変更せずに動かしました。中身は次のとおりです。

  • モデル:Reason2-2B を 4bit で読み込む
  • LoRA:r=32
  • データ:trl-lib/llava-instruct-mix(画像つきの指示データ)の 10%
  • 学習:10 ステップ、実効バッチ 16
git clone https://github.com/nvidia-cosmos/cosmos-reason2.git
cd cosmos-reason2/examples/notebooks
uv sync                                  # 約 3 分
.venv/bin/python trl_sft.py              # データの取得込みで約 5 分
項目 結果
学習時間 91.8 秒(10 ステップ)
GPU メモリの最大使用量 11.6GB(48GB の 24%)。16GB の GPU でも足りる見込み
loss 1.691 → 1.516
出力 LoRA アダプタ(チェックポイント込みで 232MB)

使ったライブラリの版は、torch 2.8.0・trl 0.26.1・peft 0.18.0・transformers 4.57.3・bitsandbytes 0.49.0 です。

微調整の前と後を比べる

同じ画像・同じ質問で、元のモデルと、LoRA を付けたモデルの答えを比べました。

比較に使ったスクリプト(ft_compare.py)
#!/usr/bin/env python3
"""Compare Cosmos-Reason2-2B base vs base+LoRA adapter on the same image/questions.
usage: ft_compare.py ADAPTER_DIR IMAGE OUT.json
"""
import json, sys, time
import torch
from PIL import Image
from peft import PeftModel
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration

BASE = "nvidia/Cosmos-Reason2-2B"
adapter, img_path, out = sys.argv[1], sys.argv[2], sys.argv[3]
image = Image.open(img_path).convert("RGB")
QUESTIONS = [
    "Describe this image in detail.",
    "What should the robot do to put the flower into the red bottle? Answer in 3 short steps.",
]
processor = AutoProcessor.from_pretrained(BASE)


def ask(model, q):
    msgs = [{"role": "user", "content": [{"type": "image", "image": image}, {"type": "text", "text": q}]}]
    inputs = processor.apply_chat_template(msgs, tokenize=True, add_generation_prompt=True,
                                           return_dict=True, return_tensors="pt").to(model.device)
    t0 = time.time()
    ids = model.generate(**inputs, max_new_tokens=256, do_sample=False)
    dt = time.time() - t0
    text = processor.batch_decode([ids[0][inputs.input_ids.shape[1]:]], skip_special_tokens=True)[0]
    return text.strip(), round(dt, 2)


model = Qwen3VLForConditionalGeneration.from_pretrained(BASE, dtype="auto", device_map="auto")
res = []
for q in QUESTIONS:
    a, dt = ask(model, q)
    print(f"\n=== BASE ({dt}s)\nQ: {q}\nA: {a}")
    res.append({"variant": "base", "question": q, "answer": a, "seconds": dt})
model = PeftModel.from_pretrained(model, adapter)
for q in QUESTIONS:
    a, dt = ask(model, q)
    print(f"\n=== BASE+LoRA ({dt}s)\nQ: {q}\nA: {a}")
    res.append({"variant": "lora", "question": q, "answer": a, "seconds": dt})
print(f"\npeak GPU memory = {torch.cuda.max_memory_allocated() / 2**30:.1f} GB")
json.dump(res, open(out, "w"), ensure_ascii=False, indent=2)
print(f"saved {out}")
質問(下は実際に送ったプロンプト) 元のモデル 微調整後(10 ステップ)
画像を詳しく説明して
Describe this image in detail.
ロボットと 3 つの花瓶を、物語風に説明 「机の上に 4 つの物(花・青・赤・黄の花瓶)、花は左、花瓶は右」と、数えて並べる書き方に変わった(学習データの形式に寄った)
花を赤い瓶に入れる 3 手順
What should the robot do to put the flower into the red bottle? Answer in 3 short steps.
「Of course.」で始まる箇条書き 3 つ 短い 1 段落(つかむ → 運ぶ → 入れる)

10 ステップでも、答え方の癖は学習データに寄りました。ただし、正しさの向上を測れる量ではありません。自分の用途に使うときは、学習データを自分の「画像+質問+答え」に差し替え、ステップ数を増やすことになります。

4. ③ 次の動きを予測する動画を作る(Cosmos3-Edge の Generator)

設定は、Hugging Face のモデルカードどおりにしました:Diffusers の Cosmos3OmniPipeline、832×480、121 フレーム(24fps・約 5 秒)、20 ステップ、guidance_scale=6.0、flow_shift=12.0、Guardrail(安全チェック)あり。

uv venv --python 3.13 --seed --managed-python && source .venv/bin/activate
uv pip install --torch-backend=auto "diffusers @ git+https://github.com/huggingface/diffusers.git" \
  accelerate av cosmos_guardrail huggingface_hub imageio imageio-ffmpeg torch torchvision transformers
# 約 25 分かかった。①② の間に裏で入れておくとよい

python gen_i2v.py --image example_reasoning_input.png \
  --prompt-json robot_i2v_prompt.json --negative-json negative_prompt.json \
  --out robot_next_json.mp4

メモリの退避(オフロード)なしで、48GB に収まりました(最大 12.4GB)。1 本目だけ、モデルの読み込みに 43 秒かかりました(2 本目からは 8 秒)。使ったライブラリの版は、torch 2.15.0・diffusers 0.44.0.dev0・transformers 5.23.0 です。

動画を生成するスクリプト(gen_i2v.py)
#!/usr/bin/env python3
"""Cosmos3-Edge image-to-video (predict the next motion) with Diffusers, per the HF model card.
usage: gen_i2v.py --image IMG --prompt TEXT|--prompt-json FILE --out OUT.mp4 [--frames 121] [--offload] [--steps 20]
"""
import argparse, json, time
import torch
from diffusers import Cosmos3OmniPipeline, UniPCMultistepScheduler
from diffusers.utils import export_to_video, load_image

ap = argparse.ArgumentParser()
ap.add_argument("--image", required=True)
ap.add_argument("--prompt")
ap.add_argument("--prompt-json")
ap.add_argument("--negative-json")
ap.add_argument("--out", required=True)
ap.add_argument("--frames", type=int, default=121)
ap.add_argument("--steps", type=int, default=20)
ap.add_argument("--height", type=int, default=480)
ap.add_argument("--width", type=int, default=832)
ap.add_argument("--offload", action="store_true")
ap.add_argument("--no-guardrail", action="store_true")
a = ap.parse_args()

prompt = json.dumps(json.load(open(a.prompt_json))) if a.prompt_json else a.prompt
neg = json.dumps(json.load(open(a.negative_json))) if a.negative_json else None

t0 = time.time()
pipe = Cosmos3OmniPipeline.from_pretrained("nvidia/Cosmos3-Edge", torch_dtype=torch.bfloat16,
                                           enable_safety_checker=not a.no_guardrail)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=12.0,
                                                     use_karras_sigmas=False)
if a.offload:
    pipe.enable_model_cpu_offload()
else:
    pipe.to("cuda")
t_load = time.time() - t0
print(f"loaded in {t_load:.1f}s (offload={a.offload})", flush=True)

torch.cuda.reset_peak_memory_stats()
t1 = time.time()
result = pipe(image=load_image(a.image), prompt=prompt, negative_prompt=neg,
              num_frames=a.frames, height=a.height, width=a.width, fps=24.0,
              num_inference_steps=a.steps, guidance_scale=6.0,
              generator=torch.Generator(device="cuda").manual_seed(0),
              add_resolution_template=False, add_duration_template=False)
t_gen = time.time() - t1
export_to_video(result.video, a.out, fps=24, macro_block_size=1)
peak = torch.cuda.max_memory_allocated() / 2**30
print(f"generated {a.frames} frames {a.width}x{a.height} in {t_gen:.1f}s, peak GPU memory {peak:.1f} GB -> {a.out}")
json.dump({"out": a.out, "frames": a.frames, "steps": a.steps, "load_s": round(t_load, 1),
           "gen_s": round(t_gen, 1), "peak_gb": round(peak, 1), "offload": a.offload},
          open(a.out + ".json", "w"))

以下の 3 本は、どれも 832×480・121 フレーム・20 ステップ・seed 0 で、ネガティブプロンプトには公式の negative_prompt.json を使っています。

結果 1:公式の例を再現(車載カメラ → 落石)

モデルカードの例にある公式のサンプル画像と、プロンプト(example_i2v_prompt.json)をそのまま使いました。プロンプトは、登場する物(車載カメラの視点の車と、落石)、背景・照明・カメラの設定、時間ごとの動き(0〜2 秒:カーブを走る → 2〜4 秒:落石 → 4〜5 秒:急ブレーキで停止)を JSON で書いたものです。

結果 1 の動画(約 5 秒)。プロンプトのとおり、カーブを走ったあとに落石が起きます。生成時間は 108.6 秒。
海沿いの山道を走る車載カメラの映像。後半で崖から岩が崩れ、道をふさぐ
0・40・80・120 フレーム目。

結果 2:ロボットが花を赤い瓶に入れる(短い文章のプロンプト)

次に、2 章と同じロボットの画像を入力にして、短い英文 1 つで指示しました。

A white robotic arm moves down to the wooden table, grasps the red flower with its gripper, lifts it, moves it to the right and places it into the red bottle. Static camera, realistic lighting, smooth robot motion.

(訳:白いロボットアームが机まで下がり、グリッパーで赤い花をつかんで持ち上げ、右へ運んで赤い瓶に入れる。カメラ固定、自然な照明、なめらかな動き。)

結果 2 の動画。指示どおりにはなりませんでした。別のグリッパーが上から現れ、花ではなく赤い瓶を持ち上げ、瓶の形も四角から丸に変わっています。生成時間は 73.3 秒。
2 本目のグリッパーが現れ、赤い瓶を持ち上げてしまう
0・40・80・120 フレーム目。

結果 3:同じ指示を、構造化した JSON のプロンプトにする

結果 2 と同じ内容を、公式の例と同じ項目立ての JSON に書き直しました。腕は 1 本、動くのは花だけ、花瓶は動かない、カメラは固定、時間ごとの動作、をはっきり書いています。要点の抜粋は次のとおりです。

{
  "subjects": [
    {
      "description": "A single white robotic arm (Franka-style) with a white parallel gripper and a black wrist camera, mounted behind a light wooden table",
      "number_of_arms": 1,
      "action": "Moves down to the red flower on the left side of the table, closes the gripper on the green stem, lifts the flower, moves it to the right and inserts the stem into the opening of the red square bottle, then opens the gripper"
    },
    {
      "description": "A toy flower with a long green stem and a red flower head with a yellow center",
      "state_changes": "Lying on the table -> standing in the red bottle"
    },
    {
      "description": "Three vases on the right side of the table: a blue round vase, a red square bottle, and a cream yellow vase",
      "state_changes": "None. The vases keep their shapes, colors and positions"
    }
  ],
  "cinematography": {
    "camera_motion": "Static camera, no camera movement"
  },
  "actions": [
    {
      "time": "0:00-0:02",
      "description": "The robot arm moves down to the flower on the left and closes the gripper on the stem"
    },
    {
      "time": "0:02-0:04",
      "description": "The robot lifts the flower and moves it to the right, above the red square bottle"
    },
    {
      "time": "0:04-0:05",
      "description": "The robot lowers the stem into the red bottle and opens the gripper; the flower stands in the bottle"
    }
  ],
  "temporal_caption": "A single white robot arm picks up the red flower from the left side of the table and puts it into the red square bottle. Only the flower moves; the vases stay in place. The camera is static."
}
JSON の全文(robot_i2v_prompt.json)
{
  "subjects": [
    {
      "description": "A single white robotic arm (Franka-style) with a white parallel gripper and a black wrist camera, mounted behind a light wooden table",
      "appearance_details": "Glossy white links, white two-finger gripper, black cable and small black camera on the wrist",
      "relationship": "The only robot in the scene; it manipulates the red flower",
      "location": "Upper center of the frame, above the table",
      "relative_size": "Large",
      "orientation": "Facing the camera and the table",
      "pose": "Gripper open, hovering above the table",
      "action": "Moves down to the red flower on the left side of the table, closes the gripper on the green stem, lifts the flower, moves it to the right and inserts the stem into the opening of the red square bottle, then opens the gripper",
      "state_changes": "Gripper open -> closed on the flower stem -> open after the flower is placed in the red bottle",
      "number_of_subjects": 1,
      "number_of_arms": 1,
      "number_of_legs": 0
    },
    {
      "description": "A toy flower with a long green stem and a red flower head with a yellow center",
      "appearance_details": "Plastic, bright red petals, green leaves",
      "relationship": "The object being picked up by the robot",
      "location": "Lying on the left side of the table",
      "relative_size": "Small",
      "orientation": "Lying flat, stem pointing left",
      "action": "Is grasped, lifted and placed upright into the red bottle",
      "state_changes": "Lying on the table -> standing in the red bottle",
      "number_of_subjects": 1
    },
    {
      "description": "Three vases on the right side of the table: a blue round vase, a red square bottle, and a cream yellow vase",
      "appearance_details": "Ceramic, glossy. The red bottle is square with a narrow neck",
      "relationship": "The red square bottle is the target container. The vases do not move",
      "location": "Right half of the table, in a row",
      "relative_size": "Small",
      "orientation": "Standing upright",
      "action": "Remain still on the table",
      "state_changes": "None. The vases keep their shapes, colors and positions",
      "number_of_subjects": 3
    }
  ],
  "background_setting": "A robotics lab with white cabinets, two tripod-mounted cameras on the left and right edges of the table, light wooden tabletop",
  "lighting": {
    "conditions": "Bright, even indoor lighting",
    "direction": "Top-lit",
    "shadows": "Soft shadows under the objects",
    "illumination_effect": "Clean, clear visibility"
  },
  "aesthetics": {
    "composition": "Static third-person view of the table and robot, same framing as the input image",
    "color_scheme": "White robot, light wood, red, blue and cream vases, red flower",
    "mood_atmosphere": "Calm, precise lab demonstration"
  },
  "cinematography": {
    "camera_motion": "Static camera, no camera movement",
    "framing": "Medium-wide shot",
    "camera_angle": "Slightly high angle",
    "depth_of_field": "Deep",
    "focus": "Robot gripper, flower and red bottle in sharp focus"
  },
  "style_medium": "Live-action video",
  "artistic_style": "Realistic robot demonstration footage",
  "context": "A single robot arm performs a pick-and-place task: putting the flower into the red bottle",
  "actions": [
    {
      "time": "0:00-0:02",
      "description": "The robot arm moves down to the flower on the left and closes the gripper on the stem"
    },
    {
      "time": "0:02-0:04",
      "description": "The robot lifts the flower and moves it to the right, above the red square bottle"
    },
    {
      "time": "0:04-0:05",
      "description": "The robot lowers the stem into the red bottle and opens the gripper; the flower stands in the bottle"
    }
  ],
  "temporal_caption": "A single white robot arm picks up the red flower from the left side of the table and puts it into the red square bottle. Only the flower moves; the vases stay in place. The camera is static.",
  "resolution": {
    "W": 832,
    "H": 480
  },
  "aspect_ratio": "16,9",
  "duration": "5s",
  "fps": 24
}
結果 3 の動画。花をつかみ、赤い瓶に差し込むところまでできました。ただし、途中で腕の見た目が別のロボットに入れ替わっています。生成時間は 90.0 秒。
ロボットが花の茎をつかみ、持ち上げて赤い瓶に入れる
0・40・80・120 フレーム目。

分かったこと

Edge の Generator は、短い文章よりも、公式の例と同じ構造化した JSON のプロンプトのほうが指示に従いました。次の点を書くと効果がありました。

  • 動く物と動かない物(「花瓶は動かない」)
  • 腕の本数(number_of_arms: 1)
  • 時間ごとの動作(actions)
  • カメラを固定すること

それでも、物の見た目が途中で変わる(腕の入れ替わりなど)ことがあります。生成した動画をロボット学習のデータなどに使う場合は、人の目で確かめる工程が必要だと感じました。

5. つまずいたところ

  • Hugging Face での同意を先に済ませる。Reason2-2B は同意が必要で、課金中に手が止まりました(約 10 分のロス)。
  • Reasoner は temperature=0 にしない。計画の質問で、同じ行の繰り返しになりました(2 章)。
  • Generator は構造化した JSON のプロンプトで書く。短い文章では、指示と違う物を動かしました(4 章)。
  • GPU は 1 つのプロセスで使う。vLLM は GPU メモリの約 92% を先に確保します。① のサーバーを止めてから ②③ に進みます。
  • Diffusers の環境構築に約 25 分かかる。課金中の待ち時間を減らすため、① の間に裏で入れておきます。
  • ディスクは合計 79GB を使った。内訳は、vLLM のイメージ 19GB、モデル、Python の環境 2 つです。100GB の型ではぎりぎりです。
  • Reason2 は前の世代。開発は終了しています。Cosmos 3 自体の微調整には GPU が 4〜8 枚必要で、今回は行っていません。

6. 終了する(必須)

brev delete cosmos-box        # 元に戻せない。モデルも出力も消える(必要なものは先に scp で手元へ)
brev ls                       # 一覧から消えたことを確認

削除を指示してから 34 秒で、一覧から消えました。作成時に動かした自動削除のコマンドも、忘れずに止めておきます。

7. 実際にかかった時間と費用

今回の費用は約 0.6 ドルでした(作成から削除まで約 50 分 × 0.68 ドル/時 ≈ 0.57 ドル)。予算 5 ドルの 12% ほどです。

経過時間(実測) 作業
0 分 インスタンスを作成
8〜17 分 準備(Hugging Face へのログイン、vLLM イメージとモデルの取得、動画生成の環境構築を裏で開始)
17〜24 分 ① Reasoner の起動と推論
24〜33 分 Reason2-2B の同意待ち(先に済ませておけば不要)
33〜40 分 ② 微調整と前後の比較
40〜48 分 ③ 動画の生成 3 本
49 分 結果を手元に保存して削除

この金額は、作成から削除までの時間に単価を掛けた概算です。実際の請求額とは、わずかに差が出る可能性があります。

まとめ

  • Cosmos3-Edge は、48GB の GPU 1 台で、理解(Reasoner)も動画生成(Generator)も動きました。GPU メモリの使用量は最大 12.4GB でした。
  • Reasoner は 1 秒前後で、画像の説明や作業の計画を返します。サンプリングの設定は既定のままにします。
  • Generator は、構造化した JSON のプロンプトで書くと指示に従いやすくなります。それでも見た目の破綻は起きるので、人による確認が必要です。
  • Cosmos 3 自体の微調整には複数の GPU が必要です。GPU 1 台では、前の世代の Reason2-2B で流れを体験できます。
  • ここまでを試して、約 50 分・約 0.6 ドルでした。まず触ってみる、という用途なら十分に手の届く範囲です。

同じ Brev を使って、ロボットシミュレータの Isaac Sim / Isaac Lab をブラウザだけで動かした記事も公開しています。あわせてご覧ください。

参考リンク

新規CTA