invoke-ai/InvokeAI · error · HTTPException

User account is inactive or does not exist

Error message

User account is inactive or does not exist

What it means

For the VP-SDE path, the scheduler builds betas from beta_schedule; only 'linear', 'scaled_linear', and the cosine schedule are implemented. Any other beta_schedule string hits the else branch raising NotImplementedError.

Source

Thrown at invokeai/app/api/auth_dependencies.py:144

            detail="Missing authentication credentials",
            headers={"WWW-Authenticate": "Bearer"},
        )

    token = credentials.credentials
    token_data = verify_token(token)

    if token_data is None:
        raise HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="Invalid or expired authentication token",
            headers={"WWW-Authenticate": "Bearer"},
        )

    # Verify the token still grants access: user exists, is active, epoch is current.
    user = resolve_authorized_user(token_data)

    if user is None:
        raise HTTPException(
            status_code=status.HTTP_401_UNAUTHORIZED,
            detail="User account is inactive or does not exist",
            headers={"WWW-Authenticate": "Bearer"},
        )

    return _db_derived_token_data(token_data, user)


def get_current_user_or_default(
    credentials: Annotated[HTTPAuthorizationCredentials | None, Depends(security)],
) -> TokenData:
    """Get current authenticated user from Bearer token, or return a default system user if not authenticated.

    This dependency is useful for endpoints that should work in both single-user and multiuser modes.

    When multiuser mode is disabled (default), this always returns a system user with admin privileges,
    allowing unrestricted access to all operations.

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Use one of the implemented schedules: 'linear', 'scaled_linear', or the cosine schedule ('cosine')
  2. Rename the config value, e.g. diffusers' 'squaredcos_cap_v2' -> cosine path used here
  3. Subclass the scheduler and add the desired beta schedule to the if/elif chain
  4. Pass precomputed trained_betas directly instead of a named schedule

Example fix

// before
sched = ERSDEScheduler(beta_schedule="squaredcos_cap_v2")
// after
sched = ERSDEScheduler(beta_schedule="linear")  # or pass trained_betas=[...]
Defensive patterns

Strategy: validation

Validate before calling

assert beta_schedule in ("linear", "scaled_linear", "cosine"), beta_schedule

Type guard

def is_supported_beta_schedule(bs) -> bool:
    return bs in ("linear", "scaled_linear", "cosine")

Try / catch

try:
    sched = ERSDEScheduler(beta_schedule=bs)
except NotImplementedError as e:
    if "beta_schedule" in str(e):
        sched = ERSDEScheduler(beta_schedule="linear")
    else:
        raise

Prevention

When it happens

Trigger: ERSDEScheduler(beta_schedule='squaredcos_cap_v2', ...) or 'quadratic'/'sigmoid' — names valid in other diffusers schedulers but not handled here; also scheduler configs copied verbatim from DDIM/DDPM presets.

Common situations: Porting a scheduler config from diffusers where beta_schedule names differ, typos like 'scaled-linear', or new model cards listing beta schedules this port hasn't implemented.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/874b7680c6027ddd. Report an issue: GitHub.