Skip to content

Config Reference

mzuelch edited this page Jan 25, 2026 · 2 revisions

The backend is configured via patchbay_backend.config.Config (a plain dataclass). The GUI and CLI both ultimately build this object and call run_pipeline(cfg).

Tip: the GUI’s “Copy snippet / Save snippet” output is the canonical example of a complete config.

Field-by-field

Field Type Default Meaning / notes
model str HuggingFace model id or local path passed to SAMAudioProcessor.from_pretrained(...).
audio str Input audio path. The backend loads mono ((1, T)).
description str Text prompt describing the target sound.
out_target str Output path for extracted target audio (wav).
out_residual str Output path for residual audio (wav).
predict_spans bool False Passed to the model (model.separate(..., predict_spans=...)).
reranking_candidates int 1 Passed to the model (reranking_candidates).
device str "auto" "auto", "cuda" or "cpu"; resolved in patchbay_backend.separator.resolve_device.
fp16 bool True Enables autocast on CUDA. Ignored on CPU.
max_len_s Optional[float] None If set: enables chunking (window length). If None: process full file in one pass.
overlap_s Optional[float] None Overlap between chunks (seconds). If chunking is enabled and overlap_s is None, a conservative default is applied. If overlap_s is set but max_len_s is None, overlap is ignored.
anchor_mode str "strict" How anchors are applied during chunking. See Anchors & Markers and Anchor Prompting Internals.
anchors List[Anchor] [] Temporal spans: ("+"/"-", start_s, end_s) in seconds (global timeline).
no_resample bool False If False (default): audio is resampled to the model’s expected sample rate.
log_file Optional[str] None If set: writes a diagnostic log (timings, memory info, etc.).
debug bool False If True and log_file is enabled: emits extra debug details.

Validation rules (selected)

Config.validate_basic() performs basic checks such as:

  • output paths must not be empty
  • reranking_candidates >= 1
  • anchor_mode must be in ANCHOR_MODE_CHOICES
  • anchors must have end_s > start_s

Final clipping of anchors to the audio duration happens during the run (see patchbay_backend.anchors.validate_and_clip_anchors).

Last updated: 2026-01-24

flowchart LR
  subgraph UI[GUI tabs]
    T1[Input & Anchors]
    T2[Description & Run]
    T3[Output]
  end

  subgraph CFG[Config fields]
    A[audio]
    B[anchors + anchor_mode]
    C[description]
    D[model + device + fp16]
    E[max_len_s + overlap_s]
    F[predict_spans + reranking_candidates]
    G[out_target + out_residual]
  end

  T1 --> A
  T1 --> B
  T2 --> C
  T2 --> D
  T2 --> E
  T2 --> F
  T3 --> G
Loading

This mapping is useful when you debug “why did the backend run with parameter X?” — you can see which UI surface owns the field.

Clone this wiki locally