more lint
This commit is contained in:
parent
1cf8c7eff6
commit
065df23902
|
@ -26,7 +26,11 @@ class TileCallback(Protocol):
|
|||
"""
|
||||
|
||||
def __call__(
|
||||
self, sources: List[Image.Image], mask: Image.Image, dims: Tuple[int, int, int], progress: Tuple[int, int]
|
||||
self,
|
||||
sources: List[Image.Image],
|
||||
mask: Image.Image,
|
||||
dims: Tuple[int, int, int],
|
||||
progress: Tuple[int, int],
|
||||
) -> StageResult:
|
||||
"""
|
||||
Run this stage against a single tile.
|
||||
|
@ -273,9 +277,7 @@ def process_tile_stack(
|
|||
single_tile = total_tiles == 1
|
||||
|
||||
for counter, (left, top) in enumerate(tile_coords):
|
||||
logger.info(
|
||||
"processing tile %s of %s, %sx%s", counter, total_tiles, left, top
|
||||
)
|
||||
logger.info("processing tile %s of %s, %sx%s", counter, total_tiles, left, top)
|
||||
|
||||
right = left + tile
|
||||
bottom = top + tile
|
||||
|
@ -343,7 +345,9 @@ def process_tile_stack(
|
|||
tile_mask = mask.crop((left, top, right, bottom))
|
||||
|
||||
for image_filter in filters:
|
||||
tile_stack = image_filter(tile_stack, tile_mask, (left, top, tile), (counter, total_tiles))
|
||||
tile_stack = image_filter(
|
||||
tile_stack, tile_mask, (left, top, tile), (counter, total_tiles)
|
||||
)
|
||||
|
||||
# TODO: this should be inverted to extract them from the result
|
||||
if isinstance(tile_stack, list):
|
||||
|
|
|
@ -160,7 +160,7 @@ def image_reply(
|
|||
return data
|
||||
|
||||
|
||||
def multi_image_reply(results: Dict[str, Any]):
|
||||
def multi_image_reply(results: List[Dict[str, Any]]):
|
||||
return jsonify(
|
||||
{
|
||||
"results": results,
|
||||
|
@ -180,7 +180,10 @@ def introspect(server: ServerContext, app: Flask):
|
|||
return {
|
||||
"name": "onnx-web",
|
||||
"routes": [
|
||||
{"path": url_from_rule(rule), "methods": list(rule.methods or []).sort()}
|
||||
{
|
||||
"path": url_from_rule(rule),
|
||||
"methods": list(rule.methods or []),
|
||||
}
|
||||
for rule in app.url_map.iter_rules()
|
||||
],
|
||||
}
|
||||
|
@ -687,7 +690,7 @@ def job_status(server: ServerContext, pool: DevicePoolExecutor):
|
|||
outputs = None
|
||||
metadata = None
|
||||
if progress.result is not None and len(progress.result) > 0:
|
||||
# TODO: the names should be attached to the result somehow rather than recomputing them
|
||||
# TODO: the names should be attached to the result when it is saved rather than recomputing them
|
||||
outputs = make_output_names(server, job_name, len(progress.result))
|
||||
metadata = progress.result.metadata
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
import { RetryParams } from './api.js';
|
||||
import { BaseImgParams, HighresParams, Img2ImgParams, InpaintParams, Txt2ImgParams, UpscaleParams } from './params.js';
|
||||
|
||||
export interface Border {
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
bottom: number;
|
||||
}
|
||||
|
||||
export interface Progress {
|
||||
current: number;
|
||||
total: number;
|
||||
|
@ -26,7 +33,7 @@ export interface ImageMetadata<TParams extends BaseImgParams, TType extends JobT
|
|||
loras: Array<NetworkMetadata>;
|
||||
models: Array<NetworkMetadata>;
|
||||
|
||||
border: unknown; // TODO: type
|
||||
border: Border;
|
||||
highres: HighresParams;
|
||||
upscale: UpscaleParams;
|
||||
size: Size;
|
||||
|
|
Loading…
Reference in New Issue