Default Settings for Modly: Complete Configuration Reference

Modly applies a hierarchy of hard-coded CLI defaults, environment variables, and user-level settings.json files to configure its API endpoints, file paths, and 3D generation parameters, with all core defaults defined in tools/modly-cli/agent.py.

Modly is an open-source 3D asset generation toolkit hosted in the lightningpixel/modly repository. Its behavior is governed by a structured configuration system that combines environment variables, JSON configuration files, and fallback constants defined directly in the source code.

API and Network Defaults

The networking layer initializes with localhost-centric defaults designed for local development.

  • API Base URL: http://127.0.0.1:8765 (overridable via MODLY_API_URL environment variable) — defined at line 40 of tools/modly-cli/agent.py
  • Backend Host: "127.0.0.1" — line 1172
  • Backend Port: 8765 — line 1173
  • Per-Request Timeout: 30 seconds for individual HTTP operations — line 1189
  • ComfyUI Integration: Default URL is http://127.0.0.1:8188, configurable via COMFYUI_URL environment variable — line 1134

CLI Timing and Polling Configuration

Modly's CLI agent uses conservative timeouts suitable for heavy 3D generation workloads.

  • CLI Timeout: 1800 seconds (30 minutes), controlled by MODLY_CLI_TIMEOUT or MODLY_AGENT_TIMEOUT — line 41
  • Polling Interval: 2.0 seconds between status checks, set via MODLY_CLI_POLL_SECONDS or MODLY_AGENT_POLL_SECONDS — line 42
  • Generation Timeout: 1800 seconds — line 1160
  • Generation Poll Interval: 2.0 seconds — line 1161

Supported File Formats

The system recognizes specific extensions for input and output operations.

Export Formats (line 43): glb, stl, obj, ply
Default Export Format (line 1144): "glb"
Supported Image Suffixes (line 44): .png, .jpg, .jpeg, .webp
Supported 3D Asset Suffixes (line 45): .glb, .gltf, .obj, .stl, .ply

3D Generation Parameters

Modly's mesh generation pipeline defaults to high-quality output settings.

  • Default ComfyUI Workflow: "Trellis2Workflow" — line 1131
  • Model Selector: "auto" (uses "active" if explicitly requested) — line 1145
  • Workspace Collection: "Agent" — line 1146
  • Remesh Mode: "quad" — line 1147
  • Texture Generation: Enabled (True) — line 1148
  • Texture Resolution: 1024 pixels — line 1151
  • Texture Atlas Size: 2048 pixels — line 1153
  • Texture Diffusion Steps: 30 — line 1154
  • Texture Guidance Strength: 3.0 — line 1155

Configuration Resolution Hierarchy

Modly resolves settings through a cascading priority system implemented in the _resolve_serve_config function (lines 15-33 of tools/modly-cli/agent.py).

  1. CLI arguments take highest precedence
  2. User settings.json files located in APPDATA/Modly/ (Windows) or ~/.config/Modly/ (Unix)
  3. Environment variables (e.g., MODLY_API_URL, HF_TOKEN)
  4. Hard-coded defaults as defined in the source

Default Directory Paths

When no user configuration exists, Modly falls back to standard local directories.

  • Models Directory: ~/.modly/models — line 28
  • Workspace Directory: ~/.modly/workspace — line 30
  • HF Token: Empty string ("") unless supplied via CLI flag, user settings, or the HF_TOKEN environment variable — lines 26-34

The settings router in api/routers/settings.py (lines 21-26) exposes these effective paths through the /settings/paths endpoint, returning the current in-process values of reg_module.MODELS_DIR and reg_module.WORKSPACE_DIR.

Querying Current Settings via the API

You can verify the active configuration at runtime using the Modly API:

import requests
import json

BASE = "http://127.0.0.1:8765"
resp = requests.get(f"{BASE}/settings/paths")
print(json.dumps(resp.json(), indent=2))

# Output: {"models_dir": "/home/user/.modly/models", "workspace_dir": "/home/user/.modly/workspace"}

To run the CLI with all defaults intact:

modly-cli generate \
  --image selfie.jpg \
  --output result.glb

# Internally applied defaults:

#   --model auto --remesh quad --texture --texture-resolution 1024 ...

To locate potential user settings files:

from pathlib import Path
import json

candidates = [
    Path.home() / ".config" / "Modly" / "settings.json",
    # Windows: Path(os.environ["APPDATA"]) / "Modly" / "settings.json"

]

for p in candidates:
    if p.exists():
        print(f"Found settings: {p}")
        print(json.loads(p.read_text()))

Summary

  • Modly's default API endpoint is http://127.0.0.1:8765 with a 30-second request timeout and 1800-second generation timeout
  • Default generation uses the "Trellis2Workflow" ComfyUI workflow with 1024px textures and quad remeshing
  • File operations default to ~/.modly/models and ~/.modly/workspace directories
  • All hard-coded defaults are defined in tools/modly-cli/agent.py, retrievable via the /settings/paths endpoint defined in api/routers/settings.py
  • Configuration resolution follows: CLI args > user JSON settings > environment variables > source code defaults

Frequently Asked Questions

How do I override Modly's default API URL?

Set the MODLY_API_URL environment variable before launching the CLI or server. According to line 40 of tools/modly-cli/agent.py, this variable supersedes the hard-coded http://127.0.0.1:8765 default.

Where does Modly store its default models and workspace?

By default, Modly uses ~/.modly/models for model storage and ~/.modly/workspace for output files, as defined at lines 28 and 30 of tools/modly-cli/agent.py. These paths are exposed via the /settings/paths API endpoint implemented in api/routers/settings.py.

What is the default texture resolution in Modly?

The default texture resolution is 1024 pixels, with texture atlases sized at 2048 pixels. These values are hard-coded at lines 1151 and 1153 of tools/modly-cli/agent.py, alongside 30 diffusion steps and a guidance strength of 3.0.

How does Modly resolve conflicting configuration values?

Modly applies a strict hierarchy implemented in the _resolve_serve_config function (lines 15-33). Explicit CLI arguments take precedence, followed by values from settings.json in the user's config directory, then environment variables, and finally the hard-coded constants defined in the source files.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →