mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-18 13:07:28 +08:00
Per @rattus128 review on PR #13685: silently coercing typo'd bool values (e.g. `--feature-flag show_signin_button=ture`) to `False` was a confusing UX. Make bool coercion strict and drop unparseable flags entirely. - `_coerce_bool`: accept only `true`/`false` (case-insensitive); raise `ValueError` for anything else (`ture`, `yes`, `1`, ``). - `_coerce_flag_value`: no longer swallows exceptions; raises on bad coercion so the caller decides what to do. - `_parse_cli_feature_flags`: catches `ValueError`/`TypeError`, logs a warning ("dropping flag"), and omits the flag from the result. ComfyUI still starts; `SERVER_FEATURE_FLAGS` retains the registered default; other valid `--feature-flag` entries on the same command line are unaffected. Tests: - `test_bool_typo_raises`: `ture`/`yes`/`1`/`""` all raise ValueError. - `test_failed_int_coercion_raises`: replaces the old "falls back to string" test now that coercion failures propagate. - `test_invalid_bool_value_dropped`: parser drops the bad flag and logs a warning, while a valid sibling flag still parses. 19/19 unit tests pass. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019df5a8-36be-7107-a4af-c7e4f51687df |
||
|---|---|---|
| .. | ||
| input | ||
| input_impl | ||
| internal | ||
| latest | ||
| torch_helpers | ||
| util | ||
| v0_0_1 | ||
| v0_0_2 | ||
| feature_flags.py | ||
| generate_api_stubs.py | ||
| util.py | ||
| version_list.py | ||