# Engine.set_variant
URL: https://lsd.tools/docs/api-engine-set-variant
Updated: 2026-07-17

## Parameters

| name | type | default | description |
|---|---|---|---|
| `identity` | `str` | — | the node identity that has variants (e.g. `"mim.solid"`) |
| `mode` | `str` | `"replace"` | `"replace"` makes `provider` win the identity; `"coexist"` reverts to the original |
| `provider` | `str \| None` | `None` | the winning step for `"replace"` mode |

## Example

```python
engine.set_variant("mim.solid", provider="mim_openpit.solid")
```

## Notes

`mode` is `"replace"` (default) or `"coexist"`. **Replace** makes `provider` win the identity and
instantly swaps every live node using it; **coexist** reverts the identity to the original, leaving
each override independently addable. The choice is persisted in the `.lsd`
(`package_state.variants`).

## See also

**API:** [run](/docs/api-engine-run) · [save](/docs/api-engine-save) · [Engine](/docs/api-engine)

**Guides:** [Node variants](/docs/tools-variants)
