Revert "chore: rebase conflicts"

This reverts commit d1fce4b70b.
This commit is contained in:
psychedelicious 2023-10-13 21:48:18 +11:00
parent ce8e5f9adf
commit 7744e01e2c
No known key found for this signature in database
2 changed files with 40 additions and 59 deletions

View File

@ -8,7 +8,7 @@ from PIL import Image, PngImagePlugin
from PIL.Image import Image as PILImageType
from send2trash import send2trash
from invokeai.app.services.invoker import Invoker
from invokeai.app.services.config.invokeai_config import InvokeAIAppConfig
from invokeai.app.util.thumbnails import get_thumbnail_name, make_thumbnail
from .image_files_base import ImageFileStorageBase
@ -22,7 +22,7 @@ class DiskImageFileStorage(ImageFileStorageBase):
__cache_ids: Queue # TODO: this is an incredibly naive cache
__cache: Dict[Path, PILImageType]
__max_cache_size: int
__invoker: Invoker
__compress_level: int
def __init__(self, output_folder: Union[str, Path]):
self.__cache = dict()
@ -31,12 +31,10 @@ class DiskImageFileStorage(ImageFileStorageBase):
self.__output_folder: Path = output_folder if isinstance(output_folder, Path) else Path(output_folder)
self.__thumbnails_folder = self.__output_folder / "thumbnails"
self.__compress_level = InvokeAIAppConfig.get_config().png_compress_level
# Validate required output folders at launch
self.__validate_storage_folders()
def start(self, invoker: Invoker) -> None:
self.__invoker = invoker
def get(self, image_name: str) -> PILImageType:
try:
image_path = self.get_path(image_name)
@ -80,12 +78,7 @@ class DiskImageFileStorage(ImageFileStorageBase):
if original_workflow is not None:
pnginfo.add_text("invokeai_workflow", original_workflow)
image.save(
image_path,
"PNG",
pnginfo=pnginfo,
compress_level=self.__invoker.services.configuration.png_compress_level,
)
image.save(image_path, "PNG", pnginfo=pnginfo, compress_level=self.__compress_level)
thumbnail_name = get_thumbnail_name(image_name)
thumbnail_path = self.get_path(thumbnail_name, thumbnail=True)

View File

@ -2679,12 +2679,6 @@ export type components = {
* @default 400
*/
tile_size?: number;
/**
* Tile Size
* @description Tile size for tiled ESRGAN upscaling (0=tiling disabled)
* @default 400
*/
tile_size?: number;
/**
* Type
* @default esrgan
@ -3357,9 +3351,6 @@ export type components = {
| components['schemas']['ColorInvocation']
| components['schemas']['ConditioningInvocation']
| components['schemas']['ConditioningCollectionInvocation']
| components['schemas']['FaceOffInvocation']
| components['schemas']['FaceMaskInvocation']
| components['schemas']['FaceIdentifierInvocation']
| components['schemas']['ControlNetInvocation']
| components['schemas']['ImageProcessorInvocation']
| components['schemas']['MainModelLoaderInvocation']
@ -3369,9 +3360,8 @@ export type components = {
| components['schemas']['SeamlessModeInvocation']
| components['schemas']['SDXLModelLoaderInvocation']
| components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['IPAdapterInvocation']
| components['schemas']['MetadataAccumulatorInvocation']
| components['schemas']['T2IAdapterInvocation']
| components['schemas']['IPAdapterInvocation']
| components['schemas']['CompelInvocation']
| components['schemas']['SDXLCompelPromptInvocation']
| components['schemas']['SDXLRefinerCompelPromptInvocation']
@ -3420,7 +3410,6 @@ export type components = {
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['RandomFloatInvocation']
| components['schemas']['FloatToIntegerInvocation']
| components['schemas']['RoundInvocation']
| components['schemas']['IntegerMathInvocation']
@ -3527,9 +3516,8 @@ export type components = {
| components['schemas']['SeamlessModeOutput']
| components['schemas']['SDXLModelLoaderOutput']
| components['schemas']['SDXLRefinerModelLoaderOutput']
| components['schemas']['IPAdapterOutput']
| components['schemas']['MetadataAccumulatorOutput']
| components['schemas']['T2IAdapterOutput']
| components['schemas']['IPAdapterOutput']
| components['schemas']['ClipSkipInvocationOutput']
| components['schemas']['SchedulerOutput']
| components['schemas']['ONNXModelLoaderOutput']
@ -3538,9 +3526,7 @@ export type components = {
| components['schemas']['String2Output']
| components['schemas']['GraphInvocationOutput']
| components['schemas']['IterateInvocationOutput']
| components['schemas']['CollectInvocationOutput']
| components['schemas']['FaceMaskOutput']
| components['schemas']['FaceOffOutput'];
| components['schemas']['CollectInvocationOutput'];
};
/**
* Errors
@ -10222,6 +10208,30 @@ export type components = {
/** Ui Order */
ui_order?: number;
};
/**
* StableDiffusion1ModelFormat
* @description An enumeration.
* @enum {string}
*/
T2IAdapterModelFormat: 'diffusers';
/**
* ControlNetModelFormat
* @description An enumeration.
* @enum {string}
*/
ControlNetModelFormat: 'checkpoint' | 'diffusers';
/**
* StableDiffusion2ModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusion2ModelFormat: 'checkpoint' | 'diffusers';
/**
* StableDiffusionXLModelFormat
* @description An enumeration.
* @enum {string}
*/
T2IAdapterModelFormat: 'diffusers';
/**
* StableDiffusionXLModelFormat
* @description An enumeration.
@ -10239,37 +10249,25 @@ export type components = {
* @description An enumeration.
* @enum {string}
*/
ControlNetModelFormat: 'checkpoint' | 'diffusers';
StableDiffusion1ModelFormat: 'checkpoint' | 'diffusers';
/**
* StableDiffusionOnnxModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusionOnnxModelFormat: 'olive' | 'onnx';
/**
* StableDiffusion1ModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusion1ModelFormat: 'checkpoint' | 'diffusers';
/**
* T2IAdapterModelFormat
* @description An enumeration.
* @enum {string}
*/
T2IAdapterModelFormat: 'diffusers';
/**
* CLIPVisionModelFormat
* @description An enumeration.
* @enum {string}
*/
CLIPVisionModelFormat: 'diffusers';
/**
* StableDiffusion2ModelFormat
* @description An enumeration.
* @enum {string}
*/
StableDiffusion2ModelFormat: 'checkpoint' | 'diffusers';
/**
* ControlNetModelFormat
* @description An enumeration.
* @enum {string}
*/
ControlNetModelFormat: 'checkpoint' | 'diffusers';
};
responses: never;
parameters: never;
@ -10411,9 +10409,6 @@ export type operations = {
| components['schemas']['ColorInvocation']
| components['schemas']['ConditioningInvocation']
| components['schemas']['ConditioningCollectionInvocation']
| components['schemas']['FaceOffInvocation']
| components['schemas']['FaceMaskInvocation']
| components['schemas']['FaceIdentifierInvocation']
| components['schemas']['ControlNetInvocation']
| components['schemas']['ImageProcessorInvocation']
| components['schemas']['MainModelLoaderInvocation']
@ -10423,9 +10418,8 @@ export type operations = {
| components['schemas']['SeamlessModeInvocation']
| components['schemas']['SDXLModelLoaderInvocation']
| components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['IPAdapterInvocation']
| components['schemas']['MetadataAccumulatorInvocation']
| components['schemas']['T2IAdapterInvocation']
| components['schemas']['IPAdapterInvocation']
| components['schemas']['CompelInvocation']
| components['schemas']['SDXLCompelPromptInvocation']
| components['schemas']['SDXLRefinerCompelPromptInvocation']
@ -10474,7 +10468,6 @@ export type operations = {
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['RandomFloatInvocation']
| components['schemas']['FloatToIntegerInvocation']
| components['schemas']['RoundInvocation']
| components['schemas']['IntegerMathInvocation']
@ -10570,9 +10563,6 @@ export type operations = {
| components['schemas']['ColorInvocation']
| components['schemas']['ConditioningInvocation']
| components['schemas']['ConditioningCollectionInvocation']
| components['schemas']['FaceOffInvocation']
| components['schemas']['FaceMaskInvocation']
| components['schemas']['FaceIdentifierInvocation']
| components['schemas']['ControlNetInvocation']
| components['schemas']['ImageProcessorInvocation']
| components['schemas']['MainModelLoaderInvocation']
@ -10582,9 +10572,8 @@ export type operations = {
| components['schemas']['SeamlessModeInvocation']
| components['schemas']['SDXLModelLoaderInvocation']
| components['schemas']['SDXLRefinerModelLoaderInvocation']
| components['schemas']['IPAdapterInvocation']
| components['schemas']['MetadataAccumulatorInvocation']
| components['schemas']['T2IAdapterInvocation']
| components['schemas']['IPAdapterInvocation']
| components['schemas']['CompelInvocation']
| components['schemas']['SDXLCompelPromptInvocation']
| components['schemas']['SDXLRefinerCompelPromptInvocation']
@ -10633,7 +10622,6 @@ export type operations = {
| components['schemas']['MultiplyInvocation']
| components['schemas']['DivideInvocation']
| components['schemas']['RandomIntInvocation']
| components['schemas']['RandomFloatInvocation']
| components['schemas']['FloatToIntegerInvocation']
| components['schemas']['RoundInvocation']
| components['schemas']['IntegerMathInvocation']