Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
b2e0d8ba
Commit
b2e0d8ba
authored
Oct 26, 2022
by
Bruno Seoane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove folder endpoint
parent
8320963d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
14 deletions
+1
-14
api.py
modules/api/api.py
+0
-9
models.py
modules/api/models.py
+1
-5
No files found.
modules/api/api.py
View file @
b2e0d8ba
...
...
@@ -32,7 +32,6 @@ class Api:
self
.
app
.
add_api_route
(
"/sdapi/v1/img2img"
,
self
.
img2imgapi
,
methods
=
[
"POST"
],
response_model
=
ImageToImageResponse
)
self
.
app
.
add_api_route
(
"/sdapi/v1/extra-single-image"
,
self
.
extras_single_image_api
,
methods
=
[
"POST"
],
response_model
=
ExtrasSingleImageResponse
)
self
.
app
.
add_api_route
(
"/sdapi/v1/extra-batch-images"
,
self
.
extras_batch_images_api
,
methods
=
[
"POST"
],
response_model
=
ExtrasBatchImagesResponse
)
self
.
app
.
add_api_route
(
"/sdapi/v1/extra-folder-images"
,
self
.
extras_folder_processing_api
,
methods
=
[
"POST"
],
response_model
=
ExtrasBatchImagesResponse
)
def
text2imgapi
(
self
,
txt2imgreq
:
StableDiffusionTxt2ImgProcessingAPI
):
sampler_index
=
sampler_to_index
(
txt2imgreq
.
sampler_index
)
...
...
@@ -126,14 +125,6 @@ class Api:
return
ExtrasBatchImagesResponse
(
images
=
list
(
map
(
encode_pil_to_base64
,
result
[
0
])),
html_info
=
result
[
1
])
def
extras_folder_processing_api
(
self
,
req
:
ExtrasFoldersRequest
):
reqDict
=
setUpscalers
(
req
)
with
self
.
queue_lock
:
result
=
run_extras
(
extras_mode
=
2
,
image
=
None
,
image_folder
=
None
,
**
reqDict
)
return
ExtrasBatchImagesResponse
(
images
=
list
(
map
(
encode_pil_to_base64
,
result
[
0
])),
html_info
=
result
[
1
])
def
pnginfoapi
(
self
):
raise
NotImplementedError
...
...
modules/api/models.py
View file @
b2e0d8ba
...
...
@@ -149,7 +149,3 @@ class ExtrasBatchImagesRequest(ExtrasBaseRequest):
class
ExtrasBatchImagesResponse
(
ExtraBaseResponse
):
images
:
list
[
str
]
=
Field
(
title
=
"Images"
,
description
=
"The generated images in base64 format."
)
\ No newline at end of file
class
ExtrasFoldersRequest
(
ExtrasBaseRequest
):
input_dir
:
str
=
Field
(
title
=
"Input directory"
,
description
=
"Directory path from where to take the images"
)
output_dir
:
str
=
Field
(
title
=
"Output directory"
,
description
=
"Directory path to put the processsed images into"
)
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