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

View File

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