Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
f62db4d5
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1749
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
f62db4d5
编写于
10月 30, 2022
作者:
E
evshiron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix progress response model
上级
7f5212fb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
34 deletion
+4
-34
modules/api/api.py
modules/api/api.py
+0
-30
modules/api/models.py
modules/api/models.py
+4
-4
未找到文件。
modules/api/api.py
浏览文件 @
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
time
import
uvicorn
import
uvicorn
from
gradio.processing_utils
import
encode_pil_to_base64
,
decode_base64_to_file
,
decode_base64_to_image
from
gradio.processing_utils
import
encode_pil_to_base64
,
decode_base64_to_file
,
decode_base64_to_image
...
...
modules/api/models.py
浏览文件 @
f62db4d5
import
inspect
import
inspect
from
click
import
prompt
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
import
Any
,
Optional
from
typing_extensions
import
Literal
from
typing_extensions
import
Literal
from
inflection
import
underscore
from
inflection
import
underscore
...
@@ -158,6 +158,6 @@ class PNGInfoResponse(BaseModel):
...
@@ -158,6 +158,6 @@ class PNGInfoResponse(BaseModel):
info
:
str
=
Field
(
title
=
"Image info"
,
description
=
"A string with all the info the image had"
)
info
:
str
=
Field
(
title
=
"Image info"
,
description
=
"A string with all the info the image had"
)
class
ProgressResponse
(
BaseModel
):
class
ProgressResponse
(
BaseModel
):
progress
:
float
progress
:
float
=
Field
(
title
=
"Progress"
,
description
=
"The progress with a range of 0 to 1"
)
eta_relative
:
float
eta_relative
:
float
=
Field
(
title
=
"ETA in secs"
)
state
:
dict
state
:
Json
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录