SenseNova U1.6 Python Deployment: 44-Minute ModelScope Snapshot, 98-Second First Image
SenseNova U1.6 Python Deployment: From Environment Preparation to Generating the First Image
Previously I deployed SenseNova U1.5 on a server myself and ran it, and I accumulated some experience with the network and dependencies. After SenseNova U1.6 was released, I first ran through the Python inference route separately from scratch: from checking the GPU, preparing the environment, and downloading the weights, all the way to confirming that the output image can be opened.
In actual execution, the process was roughly as follows:
- Confirm that the container can see the GPU, and put the working directory on the data disk.
- Use the SenseNova-U1 repository and uv to set up an independent Python environment.
- When the network is unavailable, switch to ModelScope and wait for the complete snapshot to land on disk.
- Run the t2i example and check the exit code, output file, and GPU sampling.
| Python deployment item for this run | Actual record |
|---|---|
| System precheck | Python 3.12.3, PyTorch 2.8.0+cu128, nvidia-smi shows CUDA Version 13.0 |
| Project environment | Python 3.11.18, PyTorch 2.8.0+cu128, CUDA build 12.8 |
| Model snapshot | ModelScope, 20 files, about 44 minutes |
| First image | 2048×2048, exit code 0, about 98 seconds |
This time the Python environment was Python 3.11.18, PyTorch 2.8.0+cu128, and the weights were downloaded through ModelScope. The model generated a 2048×2048 image, the inference process returned python_exit=0, and it took about 98 seconds. The Hugging Face network unreachability and the missing pip module in the virtual environment encountered along the way were also handled in their corresponding steps. ComfyUI is another entry point; this article first explains command-line inference.
1. Check the server specifications and data disk first
1. Keep the GPU specification on the page separate from the device seen in the container
When I created the instance on AutoDL, I chose the vGPU-48GB labeled on the page; the page also listed 25 CPU cores, 90GB memory, a 30GB system disk, and an expanded 100GB data disk. The platform's specification page describes the rented configuration; the actual runtime device and mount paths still need to be checked after logging in.
The platform creation page determines the rental tier first; after logging into the container, I used the terminal to verify the runtime device and disk mounts. The actual environment reported the GPU name as NVIDIA GeForce RTX 4090, and /root/autodl-tmp mounted a 100GB data disk. I put the models, caches, and generated results there; the system disk is only 30GB. The platform's vGPU-48GB label is kept as a resource tier and is not mixed with the device name returned by the container.
The platform shows the specification chosen at rental time; the container name comes from runtime information after startup. Later, when troubleshooting VRAM and CUDA, I will use the results returned by actual executed commands as the source of truth. The runtime device and mount points are all based on the inspection results inside the container.
After checking the data disk, I decided to put the models, uv cache, and generated results under /root/autodl-tmp. The system disk has less space; the repository itself is not large, but model shards and download caches together take up a fair amount of space. U16_ROOT is just an environment variable for the current shell; it is not inherited automatically when opening a new terminal. Later, a monitoring command reported that /logs did not exist because I forgot to export it again.
2. Create the working directory; all subsequent commands use the same root path
First create the project, model, output, log, and cache directories on the data disk. U16_ROOT below is the path shared by subsequent commands; if your mount point is different, only change this line.
export U16_ROOT=/root/autodl-tmp/sensenova-u16
mkdir -p "$U16_ROOT"/{repo,models,outputs,logs,workflows,cache}
export HF_HOME="$U16_ROOT/cache/huggingface"
export UV_CACHE_DIR="$U16_ROOT/cache/uv"
Once I started GPU monitoring directly in a new terminal and forgot to export U16_ROOT again, and the output path became /logs/python-gpu-monitor.csv. Every time you open a new terminal, you need to set U16_ROOT again; these lines can be kept in terminal notes and re-executed when switching windows.
This step only creates directories and environment variables; it does not install Python packages or test the GPU. Model downloads, inference outputs, and run logs go under models, outputs, and logs respectively. When troubleshooting later, the logs can locate the command that was executed at the time. Next, I use df to check mount capacity, nvidia-smi to check the device, and then have the current Python import torch, so that preparing paths is not mistaken for the environment being ready.
3. Before downloading weights, confirm the GPU, CUDA, and data disk
Before the model is downloaded, I check the mount point and whether PyTorch can access CUDA:
df -hT /root/autodl-tmp
nvidia-smi
python3 - <<'PY'
import sys
import torch
print("Python:", sys.version.split()[0])
print("PyTorch:", torch.__version__)
print("CUDA build:", torch.version.cuda)
print("CUDA available:", torch.cuda.is_available())
print("GPU:", torch.cuda.get_device_name(0))
print("BF16 supported:", torch.cuda.is_bf16_supported())
PY
The container precheck reports driver 580.105.08, CUDA 13.0, and 49140 MiB VRAM. The system Python is 3.12.3, the preinstalled PyTorch is 2.8.0+cu128, and both CUDA and BF16 are available. The project environment later will use Python 3.11 separately, so the point here is to confirm the GPU works without modifying the system Python.
The Python version in the container precheck is the version provided at the system level; the project environment created later with uv will use 3.11. Both can coexist; there is no need to uninstall the system Python. As long as the repository's .venv is activated afterwards, the inference script will be started by the project interpreter. Only after confirming that CUDA available and BF16 supported are both True do I continue installing project dependencies.
2. Build a separate Python environment for SenseNova-U1
1. Install uv, then sync dependencies with the repository lockfile
I did not copy the U1.6 project environment from U1.5; instead I created it directly from the SenseNova-U1 repository's lockfile. Previously with U1.5 I ran into a mismatch between audio dependencies and CUDA dynamic libraries. This time I put the Python project in an independent .venv and confirm the dependency state before downloading the model.
If uv is not already on the system, run:
curl -LsSf https://astral.sh/uv/install.sh -o uv-installer.sh
sh uv-installer.sh
source "$HOME/.local/bin/env"
uv --version
Enter the data disk, clone the repository, then sync the Python 3.11 environment:
cd "$U16_ROOT/repo"
git clone --depth 1 https://github.com/OpenSenseNova/SenseNova-U1.git
cd SenseNova-U1
uv sync --locked --python 3.11
source .venv/bin/activate
uv pip check
After uv sync returns, the repository will have its own .venv. Every subsequent terminal needs to reactivate it before running project commands. The pip module error I encountered also happened in this environment; the specific check method is in the next step.
2. Confirm the environment result; do not be misled by No module named pip
The first time I ran python -m pip in this .venv, the terminal returned No module named pip. What is missing here is the pip module; it does not mean torch or CUDA is not installed. This environment is managed by uv, and the dependency check should use uv pip check.
The actual result was Python 3.11.18, PyTorch 2.8.0+cu128, CUDA build 12.8, CUDA available and BF16 supported both returned True, and the 55 installed packages are compatible. The container driver reports CUDA 13.0, while the PyTorch wheel uses CUDA 12.8. These two come from different layers; this run uses PyTorch's ability to access the GPU and the completion of inference as the actual verification.
Later I reran the import check and confirmed that Python, PyTorch, and GPU all come from the U1.6 project environment. When pip is reported missing, there is no need to immediately reinstall PyTorch; first check sys.executable and torch.version, then use uv pip check to look at package relationships. In the actual result, 55 packages are compatible and CUDA returns True, which means this error points only at the pip command, not at a general failure of the model dependencies.
I did not install pip into the environment just to eliminate this error, because inference does not require starting through python -m pip. After confirming that torch imports, CUDA status, and uv's dependency check all pass, I continued downloading the weights as required by the repository, reducing changes to the already installed dependencies.
3. Switch from Hugging Face to ModelScope to download weights
1. First determine whether the error is in the network or in the model files
After the environment passed, I started downloading the U1.6 BF16 shards. The first attempt from Hugging Face returned:
Error: Local entry not found. [Errno 101] Network is unreachable
The key information is Network is unreachable, which means the network request from the server to the download endpoint did not get through; this error does not prove the repository does not exist, nor is it insufficient VRAM. I did not keep retrying the same command; I tested another download site first.
This error narrows the troubleshooting scope to the connection between the current server and the Hugging Face download endpoint. I did not change the model ID, nor did I keep waiting and retrying the same request; instead I checked whether ModelScope returns an HTTP response. This check is only for site connectivity and cannot replace a real model download.
At this point, model files have not started being written to the target directory. The error happened during the stage of establishing the remote connection; model loading and VRAM are not involved yet.
I used curl to check the ModelScope homepage. After receiving an HTTP 302 response, I proceeded to download the actual model. A homepage response only means the site is reachable; whether the target weights can be obtained still depends on the model download task itself.
curl -I --connect-timeout 10 https://modelscope.cn
HTTP 302 is the response where the homepage redirects the request to the site page, not the result of a model file download. After confirming the site responds, I still used the official model ID to start the snapshot task. If the repository name or permissions were problematic, the download task would return another type of error when accessing the model. Splitting the site test and the real model download into two steps means that when troubleshooting, 'the homepage opens' will not be mistaken for 'the weights have arrived on the server'.
So I treated this response as a signal to continue testing, not as proof of download completion. Only when the ModelScope client reports the snapshot directory of the target repository do I move to the next step of inference.
2. Download the U1.6 snapshot and wait until the task really ends
After confirming the ModelScope homepage responds, I installed the client in the activated Python environment, then saved the model to the workspace:
cd "$U16_ROOT/repo/SenseNova-U1"
source .venv/bin/activate
uv pip install modelscope
set -o pipefail
modelscope download \
--model SenseNova/SenseNova-U1.6-8B-MoT \
--local_dir "$U16_ROOT/models/SenseNova-U1.6-8B-MoT" \
2>&1 | tee "$U16_ROOT/logs/python-weight-download-modelscope.log"
The download log showed the snapshot has 20 files in total. When progress reached 35%, several safetensors shards of about 4.8GB each were being transferred. After seeing the numbers start to change, I let the downloader continue running and did not treat intermediate progress as completion.
This progress was still 7/20; the weight snapshot was not ready yet. Progress updates during large shard transfers are not necessarily continuous, so I let the current download task continue and kept the log through tee; I did not start another process writing to the same directory. After the shell prompt reappeared, I checked for 20/20 and the Snapshot ready path. This time the full download took about 44 minutes, and the snapshot landed at /root/autodl-tmp/sensenova-u16/models/SenseNova-U1.6-8B-MoT.
As long as the download process had not exited, I would not hand the target directory to the inference script. Keeping inference logs and download logs separate also makes it easier to tell whether a problem occurred in the transfer stage or the model loading stage.
After confirming the snapshot directory, I passed the model path unchanged to the Python script, without renaming it or moving it into ComfyUI's checkpoints directory. The two entry points use different file organization: the Python route uses a multi-file BF16 snapshot; ComfyUI needs a separate INT8 single-file checkpoint. For now, I use the official example in the Python environment to confirm that the current snapshot can be fully loaded.
4. Run the first Python text-to-image command
1. First verify the model and output path with fixed parameters
After the weight directory was ready, I did not add LoRA or other components; I only ran a basic image with the official text-to-image example. The input description, canvas ratio, steps, VRAM mode, and output location are all written into the command for easy reproduction later:
cd "$U16_ROOT/repo/SenseNova-U1"
source .venv/bin/activate
set -o pipefail
start_time=$(date +%s)
python examples/t2i/inference.py \
--model_path "$U16_ROOT/models/SenseNova-U1.6-8B-MoT" \
--prompt "A cinematic mountain lake at sunrise, realistic photography." \
--bucket 4m \
--aspect_ratio 1:1 \
--num_steps 50 \
--vram_mode balanced \
--attn_backend sdpa \
--output "$U16_ROOT/outputs/u16-python-t2i.png" \
2>&1 | tee "$U16_ROOT/logs/python-t2i.log"
python_exit=${PIPESTATUS[0]}
end_time=$(date +%s)
elapsed_seconds=$((end_time - start_time))
printf 'python_exit=%s\nelapsed_seconds=%s\n' "$python_exit" "$elapsed_seconds" | tee -a "$U16_ROOT/logs/python-t2i.log"
test "$python_exit" -eq 0
In the execution result, weights loaded to 1116/1116, the resolution was 2048×2048, the PNG was written to outputs/u16-python-t2i.png, python_exit=0, and it took about 98 seconds. Here you need to wait for the inference command to exit before checking whether the file was generated. Seeing only that weight loading completed does not mean the image has already been written.
I send the command output to both the terminal and a log file. PIPESTATUS[0] captures the inference program's status, and the following test makes the command explicitly fail when the exit code is not 0. When an error occurs, the log retains the loading progress and exception information from the same run, so troubleshooting does not depend on terminal scrollback.
2. Open the PNG, then decide whether this run is complete
I opened outputs/u16-python-t2i.png with a desktop preview, confirmed it is not an empty file, and the mountain-lake sunrise image matches the input scene. After the command log, exit code, and actual image all align, the Python inference chain is considered working.
This image serves here as a deployment result: the script can load the BF16 shards and write the PNG to the specified directory. It is not a U1.5-vs-U1.6 quality comparison; that kind of comparison still requires fixing the input prompt, size, random seed, and sampling settings, then recording multiple generation results separately.
3. Sample the GPU separately; do not confuse utilization with VRAM
The VRAM record comes from another run with the same parameters. In a new terminal, I re-exported U16_ROOT, then started sampling once per second; after inference ended, I pressed Ctrl+C to stop:
export U16_ROOT=/root/autodl-tmp/sensenova-u16
mkdir -p "$U16_ROOT/logs"
nvidia-smi --query-gpu=timestamp,memory.used,utilization.gpu \
--format=csv -l 1 > "$U16_ROOT/logs/python-gpu-monitor.csv"
This round collected 93 samples. The VRAM peak was 8633 MiB, and GPU utilization reached 100% multiple times. 100% is utilization, not a percentage of VRAM usage; this data corresponds only to the input, canvas, and sampling parameters at the time and cannot be directly extrapolated to other resolutions.
5. After the Python route works, leave this reproducible record
This Python deployment confirmed several things: ModelScope can download the U1.6 snapshot to the data disk, an independent Python 3.11 environment can call CUDA, and the official script can save a 2048×2048 PNG. Treat Hugging Face's Errno 101 as a network unreachable issue; when the uv environment is missing the pip module, use uv pip to check dependencies.
This article only records the Python command-line route. Server specifications, model directories, download logs, and output paths all remain on the data disk. If switching to ComfyUI next, you need to prepare a different INT8 single-file checkpoint; you cannot simply rename the BF16 shards from here and use them directly.
References:
The open-source addresses related to U1.6 are as follows:
GitHub: https://github.com/OpenSenseNova/SenseNova-U1
Hugging Face: https://huggingface.co/collections/sensenova/sensenova-u16
ComfyUI: https://huggingface.co/Comfy-Org/SenseNova-U1
ModelScope: https://www.modelscope.cn/collections/SenseNova/SenseNova-U16
SenseNova Studio: https://unify.light-ai.top/home?model=u16-lite