mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
better model version detect and experimental pydantic v2
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
+5
-4
@@ -2,6 +2,7 @@ import base64
|
||||
import os
|
||||
import io
|
||||
import time
|
||||
from typing import Union
|
||||
from pydantic import BaseModel, Field # pylint: disable=no-name-in-module
|
||||
import modules.shared as shared
|
||||
|
||||
@@ -47,7 +48,7 @@ class ProgressRequest(BaseModel):
|
||||
|
||||
class InternalProgressResponse(BaseModel):
|
||||
job: str = Field(default=None, title="Job name", description="Internal job name")
|
||||
textinfo: str = Field(default=None, title="Info text", description="Info text used by WebUI.")
|
||||
textinfo: Union[str|None] = Field(default=None, title="Info text", description="Info text used by WebUI.")
|
||||
# status fields
|
||||
active: bool = Field(title="Whether the task is being worked on right now")
|
||||
queued: bool = Field(title="Whether the task is in queue")
|
||||
@@ -61,10 +62,10 @@ class InternalProgressResponse(BaseModel):
|
||||
batch_count: int = Field(default=None, title="Total batches", description="Total number of batches")
|
||||
# calculated fields
|
||||
progress: float = Field(default=None, title="Progress", description="The progress with a range of 0 to 1")
|
||||
eta: float = Field(default=None, title="ETA in secs")
|
||||
eta: Union[float|None] = Field(default=None, title="ETA in secs")
|
||||
# image fields
|
||||
live_preview: str = Field(default=None, title="Live preview image", description="Current live preview; a data: uri")
|
||||
id_live_preview: int = Field(default=None, title="Live preview image ID", description="Send this together with next request to prevent receiving same image")
|
||||
live_preview: Union[str|None] = Field(default=None, title="Live preview image", description="Current live preview; a data: uri")
|
||||
id_live_preview: Union[int|None] = Field(default=None, title="Live preview image ID", description="Send this together with next request to prevent receiving same image")
|
||||
|
||||
|
||||
def api_progress(req: ProgressRequest):
|
||||
|
||||
Reference in New Issue
Block a user