This repository supports a local Windows setup where the MoDiff backend and Vite client run on the same workstation. The combined PowerShell launcher is the recommended development path.
- 64-bit Windows 10/11
- Git
- PowerShell 5.1 or PowerShell 7+
- Node.js
24.12.0and npm11.6.2 - A current NVIDIA driver for CUDA workflows
- Sufficient disk space for model caches, outputs, and optional offload files
The CUDA toolkit/compiler is not required for normal prebuilt PyTorch wheels, but optional packages that build native CUDA extensions may require Visual Studio Build Tools and a compatible CUDA toolchain.
Keep both checkouts next to each other for automatic detection:
C:\path\to\projects\
|-- MoDiff\
`-- MoDiff-client\
From the backend checkout:
.\install.ps1 -Accelerator auto
.\.venv\Scripts\python.exe -m modiff.preflight --json --check-port 8088 --fail-on-errorUse -Accelerator nvidia, -Accelerator intel, or -Accelerator cpu to make
the choice explicit. The Intel choice installs the preview PyTorch XPU profile
for supported Arc and integrated graphics and must pass a real xpu:0 tensor;
integrated devices share system memory and use direct residency without
CUDA-only CPU-offload hooks. The AMD Windows profile represents AMD's official
selected-hardware path but remains blocked until MoDiff pins and validates the
complete SDK wheel set; do not let pip resolve the CUDA profile on an AMD
machine. Inspect the plan without changing the machine with:
.\install.ps1 -Accelerator auto -DryRun -SystemCheck -JsonThe backend defaults to 127.0.0.1:8088 and local data paths. To customize them:
Copy-Item config.example.ini config.iniconfig.ini is ignored and can contain machine-local paths or a Hugging Face read token. Keep it private. Prefer a least-privilege token and do not paste it into prompts, logs, screenshots, or issues.
From MoDiff-client:
.\install-dev.ps1 -BackendPath ..\MoDiff -Accelerator auto
.\run-dev.ps1The launcher:
- detects the sibling backend or accepts
-BackendPath - uses and validates the backend's managed
.venv\Scripts\python.exe - runs the backend preflight before starting a new backend
- starts the backend in a dedicated PowerShell window
- starts Vite in a second window with the backend proxy configured
- uses the first free frontend port starting at
5173 - opens the browser unless
-NoBrowseris supplied
Examples:
.\run-dev.ps1 -BackendPath "C:\path\to\MoDiff" -NoBrowser
.\run-dev.ps1 -BackendPort 8089 -FrontendPort 5200 -BackendWaitSeconds 60If script execution is blocked by local policy, use a process-scoped bypass instead of changing machine-wide policy:
powershell -ExecutionPolicy Bypass -File .\run-dev.ps1.\stop-dev.ps1The script finds listeners on the configured backend/frontend port range, verifies that their command lines look like MoDiff processes, calls /runtime/gpu_cleanup when stopping the backend, and then stops only matching processes.
Useful options:
.\stop-dev.ps1 -SkipGpuCleanup
.\stop-dev.ps1 -BackendPort 8089 -FrontendPort 5200-StopAnyListener disables the command-line safety check. Use it only after inspecting the PIDs on those ports.
If the backend is already healthy:
$env:VITE_BACKEND_PROXY_TARGET = 'http://127.0.0.1:8088'
npm run dev -- --host 127.0.0.1 --port 5173Remove a stale direct-server variable before using the proxy:
Remove-Item Env:VITE_SERVER_ADDRESS -ErrorAction SilentlyContinue- Backend preflight must report the expected Python executable, Torch build, CUDA availability, and device name.
- A working CUDA runtime does not prove that a particular model fits VRAM or that every optional quantization kernel is compatible.
- Start with Auto and a lightweight image recipe before installing/running large Qwen, FLUX, Wan, or audio artifacts.
- Put Hugging Face caches and disk offload on a drive with adequate free space; configure paths through the backend, not by moving individual snapshot blobs.
- Restart the backend after changing packages, drivers, or allocator environment variables.
Client gates:
npm run check
npx playwright install chromium
npm run check:uiBackend smoke:
.\.venv\Scripts\python.exe -m modiff.preflight --json --check-port 8088 --fail-on-error
Invoke-RestMethod http://127.0.0.1:8088/health
Invoke-RestMethod http://127.0.0.1:8088/runtime/status
Invoke-RestMethod http://127.0.0.1:8088/nodes | Out-NullBefore calling the Gallery functional, also run npm run test:asset-storage
and npm run release:assets:gate, then confirm its pinned Dataset requests
succeed in a browser where you are not signed into Hugging Face.
For integrated static serving, follow Build and deployment. For listener, connection, download, and accelerator recovery, see Troubleshooting.