Skip to content

Fix: backend resolves DiT model names to full paths#9

Merged
lmangani merged 2 commits intomainfrom
copilot/fix-model-path-loading-issue
Mar 7, 2026
Merged

Fix: backend resolves DiT model names to full paths#9
lmangani merged 2 commits intomainfrom
copilot/fix-model-path-loading-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

The frontend sends model names (e.g. "acestep-v15-turbo-Q8_0") that were being passed directly to the dit-vae binary as file paths, causing failures. Additionally, ACESTEP_MODEL env vars pointing to non-existent paths (e.g. the .env.example placeholder /path/to/models/…) were trusted blindly, bypassing auto-detection.

Changes

  • config/index.tsresolveDitModel(): validates ACESTEP_MODEL path exists on disk before using it; falls through to MODELS_DIR auto-detection with a warning if not found

  • services/acestep.tsresolveParamDitModel(): new helper that owns the name→path resolution contract:

    1. No name → configured default
    2. Absolute path → pass through
    3. Exact <name>.gguf match in MODELS_DIR
    4. Prefix match with quant preference (Q8_0 → Q6_K → Q5_K_M → Q4_K_M → BF16)
    5. Nothing found → configured default

    Used in both spawn mode and HTTP mode — the UI sends a name, the backend resolves the path.

// Before — name used directly as a file path
const ditModel = params.ditModel ? params.ditModel : config.acestep.ditModel;

// After — backend owns path resolution
const ditModel = resolveParamDitModel(params.ditModel);

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix breaking issue with model path loading Fix: backend resolves DiT model names to full paths Mar 7, 2026
@lmangani lmangani marked this pull request as ready for review March 7, 2026 18:20
@lmangani lmangani merged commit 149a35b into main Mar 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants