Skip to content

Ignore empty feature flags in required flags - #1602

Closed
rvalitov wants to merge 1 commit into
mcmonkeyprojects:masterfrom
rvalitov:fix/empty-feature-flags
Closed

rvalitov wants to merge 1 commit into
mcmonkeyprojects:masterfrom
rvalitov:fix/empty-feature-flags

Conversation

@rvalitov

Copy link
Copy Markdown

Fixes #1601.

Summary

T2IParamInput.Set(...) adds param.FeatureFlag to RequiredFlags whenever it is non-null. A custom workflow parameter saved with "feature_flag": "" — the workflow editor's default, also present in the shipped Basic SDXL.json — therefore adds an empty-string flag. T2IEngine then requires a backend feature literally named '', and every backend refuses the request:

Request requires flag '' which is not present on the backend

Change

Filter null/empty/whitespace flags (and trim) when building RequiredFlags, in both Set(T2IParamType, ...) and Set<T>(T2IRegisteredParam<T>, ...):

if (!string.IsNullOrWhiteSpace(param.FeatureFlag))
{
    foreach (string flag in param.FeatureFlag.SplitFast(','))
    {
        if (!string.IsNullOrWhiteSpace(flag))
        {
            RequiredFlags.Add(flag.Trim());
        }
    }
}

This covers types produced by T2IParamType.FromNet as well as any type registered with an empty FeatureFlag.

Testing

  • Reproduced the failure with a stored workflow whose custom_params contained feature_flag: "" — the request was refused with Request requires flag ''.
  • The same workflow generates correctly after the persisted flags are set to null; with this change, an empty entry is no longer added, so existing "" values are harmless.

Custom workflow parameters can carry "feature_flag": "" (the workflow editor writes this by default, and the shipped Basic SDXL example does too). Because "" was treated as a non-null flag and SplitFast(",") yields [""], RequiredFlags gained an empty-string entry and every backend refused the request with "Request requires flag '". Skip null/whitespace flags when building RequiredFlags.
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.

Empty feature_flag in custom workflow params becomes a required flag '' and no backend matches

2 participants