File tree Expand file tree Collapse file tree 2 files changed +4
-34
lines changed Expand file tree Collapse file tree 2 files changed +4
-34
lines changed Original file line number Diff line number Diff line change 1
- # import time
2
-
3
- # from modules.api.models import StableDiffusionTxt2ImgProcessingAPI, StableDiffusionImg2ImgProcessingAPI
4
- # from modules.processing import StableDiffusionProcessingTxt2Img, StableDiffusionProcessingImg2Img, process_images
5
- # from modules.sd_samplers import all_samplers
6
- # from modules.extras import run_pnginfo
7
- # import modules.shared as shared
8
- # from modules import devices
9
- # import uvicorn
10
- # from fastapi import Body, APIRouter, HTTPException
11
- # from fastapi.responses import JSONResponse
12
- # from pydantic import BaseModel, Field, Json
13
- # from typing import List
14
- # import json
15
- # import io
16
- # import base64
17
- # from PIL import Image
18
-
19
- # sampler_to_index = lambda name: next(filter(lambda row: name.lower() == row[1].name.lower(), enumerate(all_samplers)), None)
20
-
21
- # class TextToImageResponse(BaseModel):
22
- # images: List[str] = Field(default=None, title="Image", description="The generated image in base64 format.")
23
- # parameters: Json
24
- # info: Json
25
-
26
- # class ImageToImageResponse(BaseModel):
27
- # images: List[str] = Field(default=None, title="Image", description="The generated image in base64 format.")
28
- # parameters: Json
29
- # info: Json
30
-
31
1
import time
32
2
import uvicorn
33
3
from gradio .processing_utils import encode_pil_to_base64 , decode_base64_to_file , decode_base64_to_image
Original file line number Diff line number Diff line change 1
1
import inspect
2
2
from click import prompt
3
- from pydantic import BaseModel , Field , create_model
3
+ from pydantic import BaseModel , Field , Json , create_model
4
4
from typing import Any , Optional
5
5
from typing_extensions import Literal
6
6
from inflection import underscore
@@ -158,6 +158,6 @@ class PNGInfoResponse(BaseModel):
158
158
info : str = Field (title = "Image info" , description = "A string with all the info the image had" )
159
159
160
160
class ProgressResponse (BaseModel ):
161
- progress : float
162
- eta_relative : float
163
- state : dict
161
+ progress : float = Field ( title = "Progress" , description = "The progress with a range of 0 to 1" )
162
+ eta_relative : float = Field ( title = "ETA in secs" )
163
+ state : Json
You can’t perform that action at this time.
0 commit comments