mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
feat(api): report model memory placement in memory endpoint
Add a model section to /sdapi/v1/memory with loaded-model bytes summed per pipeline component and device, so clients can tell resident weights from offloaded ones and loop-critical components from edge ones. - walk components over parameters and buffers, dedupe shared storages, key by component name then device type - read the raw model slot so a memory poll never triggers a model load - section is exception-isolated like ram and cuda; reports an error string if the walk races a reload
This commit is contained in:
@@ -552,6 +552,7 @@ class ResEmbeddings(BaseModel):
|
||||
class ResMemory(BaseModel):
|
||||
ram: dict = Field(title="RAM", description="System memory stats")
|
||||
cuda: dict = Field(title="CUDA", description="nVidia CUDA memory stats")
|
||||
model: dict = Field(default={}, title="Model", description="Loaded model bytes per component and device")
|
||||
|
||||
class ResScripts(BaseModel):
|
||||
txt2img: list[str] = Field(title="Txt2img", description="Titles of scripts (txt2img)")
|
||||
|
||||
Reference in New Issue
Block a user