use txt2img params for highres output
This commit is contained in:
parent
21666abf03
commit
be40797e59
|
@ -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
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ def stage_highres(
|
|||
EditMetadataStage(),
|
||||
stage.with_args(outscale=1),
|
||||
highres=highres,
|
||||
replace_params=params,
|
||||
)
|
||||
|
||||
return chain
|
||||
|
|
Loading…
Reference in New Issue