Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
f62db4d5
Commit
f62db4d5
authored
Oct 30, 2022
by
evshiron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix progress response model
parent
7f5212fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
34 deletions
+4
-34
modules/api/api.py
modules/api/api.py
+0
-30
modules/api/models.py
modules/api/models.py
+4
-4
No files found.
modules/api/api.py
View file @
f62db4d5
# import time
# from modules.api.models import StableDiffusionTxt2ImgProcessingAPI, StableDiffusionImg2ImgProcessingAPI
# from modules.processing import StableDiffusionProcessingTxt2Img, StableDiffusionProcessingImg2Img, process_images
# from modules.sd_samplers import all_samplers
# from modules.extras import run_pnginfo
# import modules.shared as shared
# from modules import devices
# import uvicorn
# from fastapi import Body, APIRouter, HTTPException
# from fastapi.responses import JSONResponse
# from pydantic import BaseModel, Field, Json
# from typing import List
# import json
# import io
# import base64
# from PIL import Image
# sampler_to_index = lambda name: next(filter(lambda row: name.lower() == row[1].name.lower(), enumerate(all_samplers)), None)
# class TextToImageResponse(BaseModel):
# images: List[str] = Field(default=None, title="Image", description="The generated image in base64 format.")
# parameters: Json
# info: Json
# class ImageToImageResponse(BaseModel):
# images: List[str] = Field(default=None, title="Image", description="The generated image in base64 format.")
# parameters: Json
# info: Json
import
time
import
uvicorn
from
gradio.processing_utils
import
encode_pil_to_base64
,
decode_base64_to_file
,
decode_base64_to_image
...
...
modules/api/models.py
View file @
f62db4d5
import
inspect
from
click
import
prompt
from
pydantic
import
BaseModel
,
Field
,
create_model
from
pydantic
import
BaseModel
,
Field
,
Json
,
create_model
from
typing
import
Any
,
Optional
from
typing_extensions
import
Literal
from
inflection
import
underscore
...
...
@@ -158,6 +158,6 @@ class PNGInfoResponse(BaseModel):
info
:
str
=
Field
(
title
=
"Image info"
,
description
=
"A string with all the info the image had"
)
class
ProgressResponse
(
BaseModel
):
progress
:
float
eta_relative
:
float
state
:
dict
progress
:
float
=
Field
(
title
=
"Progress"
,
description
=
"The progress with a range of 0 to 1"
)
eta_relative
:
float
=
Field
(
title
=
"ETA in secs"
)
state
:
Json
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment