
SenseNova-6.8-Code2Video
Use this model Instructions to use sensenova/SenseNova-6.8-Code2Video with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Like 63
Follow
SenseNova 694
Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
code-video
video-generation
agent
claude-code
qwen3.8
conversational
License: apache-2.0
Model card Files Files and versions xet
Community 2
Deploy
Copy to bucket
Use this model Instructions to use sensenova/SenseNova-6.8-Code2Video with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
Libraries
Transformers How to use sensenova/SenseNova-6.8-Code2Video with Transformers:
Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="sensenova/SenseNova-6.8-Code2Video") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)
pip install -U transformers accelerate
Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("sensenova/SenseNova-6.8-Code2Video") model = AutoModelForMultimodalLM.from_pretrained("sensenova/SenseNova-6.8-Code2Video", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Notebooks
Google Colab
Kaggle
Local Apps Settings
vLLM How to use sensenova/SenseNova-6.8-Code2Video with vLLM:
Install vLLM from pip:
pip install vllm
Start the vLLM server:
vllm serve "sensenova/SenseNova-6.8-Code2Video"
Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions"
-H "Content-Type: application/json"
--data '{
"model": "sensenova/SenseNova-6.8-Code2Video",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'
Use Docker
docker model run hf.co/sensenova/SenseNova-6.8-Code2Video
SGLang How to use sensenova/SenseNova-6.8-Code2Video with SGLang:
Install SGLang from pip:
pip install sglang
Start the SGLang server:
python3 -m sglang.launch_server
--model-path "sensenova/SenseNova-6.8-Code2Video"
--host 0.0.0.0
--port 30000
Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions"
-H "Content-Type: application/json"
--data '{
"model": "sensenova/SenseNova-6.8-Code2Video",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'
Use Docker images
docker run --gpus all
--shm-size 32g
-p 30000:30000
-v ~/.cache/huggingface:/root/.cache/huggingface
--env "HF_TOKEN=<secret>"
--ipc=host
lmsysorg/sglang:latest
python3 -m sglang.launch_server
--model-path "sensenova/SenseNova-6.8-Code2Video"
--host 0.0.0.0
--port 30000
Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions"
-H "Content-Type: application/json"
--data '{
"model": "sensenova/SenseNova-6.8-Code2Video",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'
Docker Model Runner How to use sensenova/SenseNova-6.8-Code2Video with Docker Model Runner:
docker model run hf.co/sensenova/SenseNova-6.8-Code2Video
Browse Quantizations to use this model in llama.cpp, Ollama, LM Studio, or any compatible app.
Released Resources
Deployment LightLLM
vLLM
SGLang
Recommended harness: Claude Code
Usage
Production trajectories
License
Contributors
SenseNova 6.8 Code2Video
A code-driven video creation model, fine-tuned from Qwen3.8-27B
Launch film (90 s, with sound), made by SenseNova 6.8 Code2Video
We present SenseNova 6.8 Code2Video, a lightweight open model for code-driven video creation. The model builds and renders videos by generating executable code, and currently focuses on short videos implemented entirely in code. Preliminary results show good visual composition and motion choreography in motion design, suggesting the potential of lightweight models for programmatic video creation.
We chose code as the entry point to video creation partly for its ability to connect different models and creative tools. Beyond building and rendering visual content directly, code can call image generation, video generation, 3D modelling and video editing models and tools, chaining generation, editing and compositing into a complete creative workflow.
We believe code can become a common language between ideas and finished work. Our long-term goal is a model that coordinates different generative models and creative tools through code to create digital content across media. SenseNova 6.8 Code2Video is a first step in this direction. Next, we will scale the model further and extend these abilities to editing, compositing, animation and 3D content creation.
Released Resources
Resource Location Description
Model weights This repository Weights, config and tokenizer
Example trajectories trajectories/ Message and tool logs with figures
Production skill GitHub Workflow, craft guides, rendering tools
Deployment
LightLLM
docker run --rm --gpus all --ipc=host -p 8000:8000
-v /path/to/SenseNova-6.8-Code2Video:/model
ghcr.io/modeltc/lightllm:main
python -m lightllm.server.api_server
--model_dir /model
--tp 4
--max_req_total_len 524288
--host 0.0.0.0 --port 8000
vLLM
docker run --rm --gpus all --ipc=host -p 8000:8000
-e VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
-v /path/to/SenseNova-6.8-Code2Video:/model
vllm/vllm-openai:latest
--model /model
--tensor-parallel-size 4
--max-model-len 524288
--reasoning-parser qwen3
--enable-auto-tool-choice
--tool-call-parser qwen3_coder
--host 0.0.0.0 --port 8000
SGLang
docker run --rm --gpus all --ipc=host -p 8000:8000
-e SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
-v /path/to/SenseNova-6.8-Code2Video:/model
lmsysorg/sglang:latest
python -m sglang.launch_server
--model-path /model
--tp-size 4
--context-length 524288
--reasoning-parser qwen3
--tool-call-parser qwen3_coder
--host 0.0.0.0 --port 8000
Recommended harness: Claude Code
A complete film is a long-horizon task: the model writes and renders code, reviews the frames and revises, turn after turn. SenseNova 6.8 Code2Video sustains runs of more than 10 hours and more than 2,000 turns. Configure Claude Code for runs of that length:
Set the context window explicitly, since Claude Code otherwise treats an unknown model as a 200K model. With compaction at 0.8 and 64K of output, every request stays within the 512K server limit.
Put the endpoint and these variables in a private settings file, and supply the credential through ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY:
{ "env": { "ANTHROPIC_BASE_URL": "https://your-endpoint.example.com", "ANTHROPIC_MODEL": "your-deployed-model-name", "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "524288", "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "80", "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "64000" }, "model": "your-deployed-model-name" }
Avoid slow shell initialization: every Bash call starts a new shell.
Usage
Producing a film has three stages:
cd /path/to/task # contains dense_prompt.md, assets/ and .claude/skills/code-video
claude -p --settings /path/to/private-settings.json --model your-deployed-model-name
--max-turns 2000 --permission-mode acceptEdits --allowedTools "Bash,Read,Write,Edit,Glob,Grep,Skill"
'Use the project code-video skill. Read .claude/skills/code-video/SKILL.md and dense_prompt.md, then the relevant craft guides. Produce the complete video and deliver out/final.mp4, SPEC.md and VERIFY.md.'
The run executes shell commands without asking, so start it in an isolated working environment. For a revision, run claude -p --continue in the same folder with the creator's notes as the prompt.
Copy the skill into .claude/skills/code-video unchanged and put task-specific requirements in the prompt. Setup steps and dependencies are in the GitHub repository.
Production trajectories
trajectories/all.openai.jsonl holds one film per line, in OpenAI messages format.
Each line contains messages, tools, images, enable_thinking and metadata. The messages include reasoning, tool calls and results, retries and compaction summaries. Images appear as <image> placeholders; the ordered images array gives their paths relative to trajectories/, and all 357 figures are in trajectories/figures/. Private paths and hosts are anonymized, so recorded commands are not directly replayable.
License
Released under the Apache License 2.0.
Contributors
We thank the following contributors for their work on SenseNova 6.8 Code2Video:
","pad_token":"<|endoftext|>","unk_token":null},"chat_template_jinja":"{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- set reasoning_instructions = '' %}\n{%- if enable_thinking is undefined or enable_thinking is true %}\n {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}\n {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}\n {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}\n {%- endif %}\n {%- if resolved_reasoning_effort == 'xhigh' %}\n {%- set reasoning_instructions = 'Re
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。