API: Add sampler override switching

Allow users to switch the currently overriden samplers via the API
so a restart isn't required to switch the overrides.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2024-01-24 01:20:58 -05:00
committed by Brian Dashore
parent de0ba7214c
commit b14c5443fd
3 changed files with 87 additions and 6 deletions

View File

@@ -0,0 +1,26 @@
from pydantic import BaseModel, Field
from typing import Optional
class SamplerOverrideSwitchRequest(BaseModel):
"""Sampler override switch request"""
preset: Optional[str] = Field(
default=None, description="Pass a sampler override preset name"
)
overrides: Optional[dict] = Field(
default=None,
description=(
"Sampling override parent takes in individual keys and overrides."
+ "Ignored if preset is provided."
),
examples=[
{
"top_p": {
"override": 1.5,
"force": False,
}
}
],
)