Connection: Documents how to install CUDA-enabled PyTorch, sync dependencies with uv, and install the
This project contains automation and docs to install the upstream WorldGen inside WSL2 (Ubuntu-22.04) using conda — exactly as their README describes. This path is the most compatible (Linux wheels for Triton/xformers, etc.).
Important notes:
- We install
torchandtorchvisionfrom the official CUDA 12.8 wheel index first. - We then run
uv syncto install the rest of the dependencies frompyproject.toml. - We install the upstream
WorldGenrepo in editable mode with--no-depsso that uv continues to fully control dependencies. - The upstream
nunchakuwheel is Linux-only; we omit it on Windows.
- Install once (inside WSL)
wsl -d Ubuntu-22.04 -- bash -lc "cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv && bash ./setup-wsl.sh"This creates a conda env worldgen, installs CUDA PyTorch, Gradio, imageio-ffmpeg, and all deps for the upstream WorldGen.
- Launch the Web UI (from Windows PowerShell)
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && python "/mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/app/web_ui.py" --port 8080'- Generate a scene
- Set Viewer URL:
http://localhost:8080(default) - Enter a Text Prompt, or upload an Image (image takes priority; prompt becomes optional guidance)
- Optional: Return Mesh (view as mesh), Save Scene (export assets), Output Dir (e.g.,
output) - Optional: GPU ID (use 0 if
nvidia-smishows a single GPU) - Click Generate
- Outputs and naming
- With Save Scene ON, exports are written under a folder auto-named from
image_stem__prompt(or justprompt):<base>.ply(original splat)<base>_xyzrgb.ply(XYZ + uint8 RGB, Blender-friendly)<base>.glb(mesh with vertex colors)images/frames and<base>.mp4when you run Save Novel Views
The Output Dir textbox can be relative (saved under this repo) or absolute.
- If an image is provided, image-to-scene runs and the prompt is optional guidance.
- If no image is provided, text-to-scene runs with the prompt only.
- In the Web UI set GPU ID (e.g.,
0). The launcher pinsCUDA_VISIBLE_DEVICESso the selected GPU is used. - Verify with:
wsl -d Ubuntu-22.04 -- bash -lc 'nvidia-smi --query-gpu=index,name,memory.total --format=csv'- In the Viser side panel:
- Camera Path: set Interpolation Steps, click Generate Camera Path.
- Render Settings: set Render FoV/Height/Width.
- Click Save Novel Views to render frames to
images/and a video<base>.mp4.
- Note: This renders new viewpoints of the existing scene; it does not generate new geometry.
- Clipping planes are extended to avoid early cut-offs and re-applied during path generation and rendering.
- Point cloud: import
<base>_xyzrgb.ply(guarantees visible colors). In Shader Editor, use Color Attribute (oftenCol) to drive Principled Base Color. For solid look, instance tiny spheres via Geometry Nodes. - Mesh: import
<base>.glb. Vertex colors are imported as a color attribute; wire it to Base Color if not auto-wired.
-
No colors in Blender:
- Use
<base>_xyzrgb.ply(uint8 RGB). In Shader, select the correct Color Attribute name.
- Use
-
MP4 writer warning about macro_block_size:
- Use a render height divisible by 16 (e.g., 1088 instead of 1080), or we can change the writer settings if needed.
-
Progress not visible during Save Novel Views:
- Logs now print progress lines every 10 frames; keep Auto-refresh logs enabled in the Web UI.
-
Outputs not appearing in Windows repo:
- The Web UI resolves relative Output Dir to the repo on Windows automatically and shows the resolved path in logs.
Inside WSL, after conda activate worldgen and cd external/WorldGen:
# Text-only
python demo.py -p "A beautiful landscape with a river and mountains"
# Image-to-scene (prompt optional)
python demo.py -i "/mnt/c/path/to/your/image.jpg" -p "Optional guidance"
# Mesh mode
python demo.py -p "A beautiful landscape with a river and mountains" --return_meshUse -o <abs_or_rel_output_dir> and --save_scene to write exports.
- Python 3.11 (uv will also manage a virtual environment)
- NVIDIA driver with CUDA 12.8 capability installed (see
nvidia-smioutput) - Windows 10/11 64-bit
Install uv if you don't have it:
pip install uvA lightweight control panel to start WorldGen runs from your browser, with fields for prompt, image upload, mesh toggle, and viewer port. It proxies to the upstream demo.py and streams logs.
Launch it from PowerShell:
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && python "/mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/app/web_ui.py" --port 8080'Open the Gradio panel at:
Controls:
- Text Prompt
- Image upload (optional)
- Return Mesh (toggle)
- Viewer Port (defaults to 8080)
- Generate / Stop and a Logs panel
Run the following commands from this project directory worldgen-uv/:
# 1) Create and activate a virtual environment managed by uv
uv venv
. .\.venv\Scripts\Activate.ps1
# 2) Install CUDA 12.8 builds of torch and torchvision first
uv pip install --index-url https://download.pytorch.org/whl/cu128 torch torchvision
# 3) Install remaining dependencies from pyproject.toml
uv sync
# 4) Install WorldGen in editable mode without pulling its deps (we manage them via uv)
uv pip install --no-deps -e git+https://github.com/ZiYang-xie/WorldGen.git#egg=worldgen
# 5) Verify the environment
uv run python .\app\main.py --checkIf you plan to use the demo or training features that require additional assets/models, follow the upstream repo instructions.
If you later use Linux and want nunchaku, you can install the linux extra group or install the wheel directly. We've provided an optional group in pyproject.toml for documentation, but it is not installed by default and is marked non-win32.
Once everything is installed, you can try using WorldGen programmatically. The app/main.py includes a stub demonstrating where you'd call the API. The real API surface may evolve upstream, so consult the upstream README for up-to-date usage.
uv run python .\app\main.py --prompt "a cozy wooden cabin interior at sunset"This should invoke WorldGen and print placeholders or perform minimal API calls if available.
If you prefer a Linux environment (recommended for packages like Triton/xformers), use WSL2 with Ubuntu 22.04. This repo includes automation scripts:
worldgen-uv/provision-worldgen-wsl.ps1(PowerShell, Windows host)worldgen-uv/setup-wsl.sh(Bash, runs inside WSL)
Steps (PowerShell):
# From the project folder: worldgen-uv/
# Optionally allow this session to run the provisioning script
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# Provision WSL and run Linux-side setup inside Ubuntu-22.04
./provision-worldgen-wsl.ps1What this does:
- Ensures WSL and the
Ubuntu-22.04distro are installed. - Maps this project path into WSL (
/mnt/c/...). - Runs
setup-wsl.sh, which follows the upstream WorldGen instructions using conda:- Installs/updates Miniconda in-place (uses
-uif already present) and configures conda-forge only (avoids Anaconda TOS). - Recreates the
worldgenconda env with Python 3.11 (removes any existing env first). - Installs CUDA 12.8
torchandtorchvisionvia the PyTorch index. - Installs build tools (
build-essential,cmake,ninja-build) for PyTorch3D. - Clones WorldGen and runs
pip install -e external/WorldGen(same aspip install .). - Installs PyTorch3D from source if needed.
- Verifies the environment with our checker script.
- Installs/updates Miniconda in-place (uses
After provisioning, open a WSL shell (Ubuntu-22.04), cd to this folder under /mnt/c/.../worldgen-uv, and run:
conda activate worldgen
python ./app/main.py --check
python ./app/main.py --prompt "a cozy wooden cabin interior at sunset"This approach mirrors upstream Linux expectations closely and avoids Windows-only wheel limitations.
bash "$HOME/miniconda.sh" -b -p "$HOME/miniconda3" source "$HOME/.bashrc"
conda config --set always_yes true conda config --set auto_activate_base false conda config --remove-key channels || true conda config --add channels conda-forge conda config --set channel_priority strict
conda create -y -n worldgen python=3.11 conda activate worldgen
pip install --index-url https://download.pytorch.org/whl/cu128 torch torchvision
git clone https://github.com/ZiYang-xie/WorldGen.git cd WorldGen pip install . cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv
python ./app/main.py --check python ./app/main.py --prompt "a cozy wooden cabin interior at sunset"
## How to run
After provisioning is complete, you can run WorldGen via our minimal script.
### From a WSL (Ubuntu-22.04) shell
```bash
conda activate worldgen
cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv
python ./app/main.py --prompt "a cozy wooden cabin interior at sunset"
# Use absolute path to conda. IMPORTANT: use single quotes so PowerShell does not expand $HOME.
wsl -d Ubuntu-22.04 -- bash -lc '$HOME/miniconda3/bin/conda run -n worldgen python /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/app/main.py --prompt "a cozy wooden cabin interior at sunset"'Alternative (source conda.sh then activate):
# Alternative: source conda.sh then activate. Again, single quotes prevent PowerShell from expanding $HOME.
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && python /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/app/main.py --prompt "a cozy wooden cabin interior at sunset"'Note: If you accidentally use double quotes in PowerShell, $HOME gets expanded on Windows (e.g., C:\Users\sha5b) and will not be a valid Linux path. Use single quotes as shown.
Run the official WorldGen demo server to visualize and explore scenes in your browser via Viser.
# Start the Viser demo server (opens http://localhost:8080)
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/external/WorldGen && python demo.py -p "a cozy wooden cabin interior at sunset"'Open: http://localhost:8080
Variants:
# Change the prompt
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/external/WorldGen && python demo.py -p "a beautiful landscape with a river and mountains"'
# Image-to-scene
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/external/WorldGen && python demo.py -i "/mnt/c/Path/To/your_image.jpg" -p "optional text description"'
# Use a different port if 8080 is busy
wsl -d Ubuntu-22.04 -- bash -lc 'source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv/external/WorldGen && python demo.py -p "..." --port 8081'Use this section to fix common issues encountered during setup and the first run.
-
Conda not found from PowerShell one-liner
- Use single quotes so
$HOMEis not expanded by PowerShell. - Example:
wsl -d Ubuntu-22.04 -- bash -lc '$HOME/miniconda3/bin/conda --version'
- Use single quotes so
-
Anaconda Terms of Service prompt
- The script configures conda-forge as the only channel to avoid TOS prompts. If you still see TOS prompts, run:
conda config --remove-key channels || trueconda config --remove-key default_channels || trueconda config --add channels conda-forgeconda config --add default_channels https://conda.anaconda.org/conda-forgeconda config --set channel_priority strict
-
No module named pytorch3d
- The setup installs PyTorch3D from source; this requires build tools.
- Ensure these are installed inside WSL:
sudo apt-get install -y build-essential cmake ninja-build- Then (inside env):
pip install "git+https://github.com/facebookresearch/pytorch3d.git"
-
g++ missing while building pytorch3d
- Install toolchain:
sudo apt-get install -y build-essential
- Install toolchain:
-
UniK3D KNN compile warning (only for evaluation)
- Optional; generation typically works without it. To compile:
source "$HOME/miniconda3/etc/profile.d/conda.sh" && conda activate worldgen && KNN_DIR="$(python -c "import unik3d, os; print(os.path.join(os.path.dirname(unik3d.__file__), 'ops','knn'))")" && cd "$KNN_DIR" && bash compile.sh
-
pkg_resources deprecation warning
- Benign. To silence:
pip install "setuptools<81"
- Benign. To silence:
-
Re-running clean setup
- The script updates Miniconda in-place and recreates the
worldgenenv automatically. Just rerun: wsl -d Ubuntu-22.04 -- bash -lc 'cd /mnt/c/Users/sha5b/Documents/GitHub/3D-Generator/worldgen-uv && bash ./setup-wsl.sh'
- The script updates Miniconda in-place and recreates the
-
First run is slow / GPU shows low util
- Large model downloads and first-time CUDA kernel builds can take time; GPU VRAM may be reserved without much util. Use
watch -n 2 nvidia-smiand be patient on the first run.
- Large model downloads and first-time CUDA kernel builds can take time; GPU VRAM may be reserved without much util. Use