1
0
Fork 0

use txt2img params for highres output

This commit is contained in:
Sean Sube 2024-01-06 17:40:36 -06:00
parent 21666abf03
commit be40797e59
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 12 additions and 6 deletions

View File

@ -1,12 +1,13 @@
from typing import Any from typing import Any, Optional
from ..params import HighresParams, ImageParams, Size, StageParams, UpscaleParams from ..params import HighresParams, ImageParams, Size, StageParams, UpscaleParams
from ..server import ServerContext from ..server import ServerContext
from ..worker import WorkerContext from ..worker import WorkerContext
from .base import BaseStage
from .result import StageResult from .result import StageResult
class EditMetadataStage: class EditMetadataStage(BaseStage):
def run( def run(
self, self,
_worker: WorkerContext, _worker: WorkerContext,
@ -15,10 +16,11 @@ class EditMetadataStage:
_params: ImageParams, _params: ImageParams,
source: StageResult, source: StageResult,
*, *,
size: Size = None, size: Optional[Size] = None,
upscale: UpscaleParams = None, upscale: Optional[UpscaleParams] = None,
highres: HighresParams = None, highres: Optional[HighresParams] = None,
note: str = None, note: Optional[str] = None,
replace_params: Optional[ImageParams] = None,
**kwargs, **kwargs,
) -> Any: ) -> Any:
# Modify the source image's metadata using the provided parameters # Modify the source image's metadata using the provided parameters
@ -26,6 +28,9 @@ class EditMetadataStage:
if note is not None: if note is not None:
metadata.note = note metadata.note = note
if replace_params is not None:
metadata.params = replace_params
if size is not None: if size is not None:
metadata.size = size metadata.size = size

View File

@ -72,6 +72,7 @@ def stage_highres(
EditMetadataStage(), EditMetadataStage(),
stage.with_args(outscale=1), stage.with_args(outscale=1),
highres=highres, highres=highres,
replace_params=params,
) )
return chain return chain