Skip to content

Managed ComfyUI install fails on Chinese Windows due to GBK decoding in groundingdino-py build #21

Description

@hoggqu

Summary

The desktop app's managed ComfyUI setup fails on a Chinese-language Windows installation while building groundingdino-py==0.4.0.

This is not a CUDA compatibility failure. PyTorch and Flash Attention install successfully; the dependency phase fails because a Python build subprocess uses the Windows system default encoding (gbk / CP936) to read UTF-8 package content.

Environment

  • 3D Gen Studio Desktop: 2.2.1
  • OS: Windows x64 with Chinese system locale
  • GPU: NVIDIA GeForce RTX 4090
  • NVIDIA driver: 610.88 (CUDA UMD 13.3)
  • Managed Python: 3.13.3
  • Managed PyTorch: 2.10.0+cu130

Steps to reproduce

  1. Install and launch the Windows desktop app.
  2. Opt into the managed ComfyUI installation.
  3. Wait until the setup reaches Installing ComfyUI dependencies.

Actual result

The setup stops with the generic message:

Dependency install failed (exit 1). See details.

The underlying uv build error is:

Failed to build `groundingdino-py==0.4.0`
The build backend returned an error
Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit code: 1)

Traceback (most recent call last):
  File "<string>", line 41, in <module>
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 2878:
illegal multibyte sequence

At this point, torch 2.10.0+cu130 is already installed and works correctly:

torch.cuda.is_available() = True
Device: NVIDIA GeForce RTX 4090

Expected result

Managed ComfyUI provisioning should succeed regardless of the Windows system locale or active ANSI code page.

Root cause

The provisioning commands launched through runStream() inherit process.env unchanged. On Chinese Windows, Python build subprocesses therefore default to GBK/CP936. groundingdino-py reads UTF-8 package text without an explicit encoding and its wheel build fails.

The runtime launch path in startComfyUI() already sets:

PYTHONIOENCODING: 'utf-8',
PYTHONUTF8: '1',

However, the managed ComfyUI provisioning path does not apply the same environment variables to the uv pip install subprocesses.

Verified workaround

Running the same setup with the following environment variables fixes the failure:

PYTHONUTF8=1
PYTHONIOENCODING=utf-8

After applying them:

  • groundingdino-py and utils3d build successfully
  • all 226 locked dependencies install
  • opencv-contrib-python and cv2.ximgproc pass verification
  • all required CUDA extensions import successfully (nvdiffrast, flash_attn, cumesh, o_voxel, flex_gemm)
  • ComfyUI 0.29.0 starts successfully and /system_stats returns HTTP 200

Suggested fix

Apply a UTF-8 environment to provisioning subprocesses, for example:

const utf8Env = {
  ...process.env,
  PYTHONUTF8: '1',
  PYTHONIOENCODING: 'utf-8',
};

await runStream(uv, args, { env: utf8Env, onLine });

This could be applied specifically throughout setupComfyUI(), or as the Windows default environment in runStream() so the Mesh Tools and Rigging installers are protected from the same locale-dependent failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions