@@ -95,7 +95,7 @@ def expected_components(self) -> List[ComponentSpec]:
9595 ComponentSpec (
9696 "image_processor" ,
9797 VaeImageProcessor ,
98- config = FrozenDict ({"vae_scale_factor" : 16 }),
98+ config = FrozenDict ({"vae_scale_factor" : 16 , "vae_latent_channels" : 16 }),
9999 default_creation_method = "from_config" ,
100100 ),
101101 ]
@@ -143,10 +143,6 @@ def __call__(self, components: FluxModularPipeline, state: PipelineState):
143143class FluxKontextProcessImagesInputStep (ModularPipelineBlocks ):
144144 model_name = "flux-kontext"
145145
146- def __init__ (self , _auto_resize = True ):
147- self ._auto_resize = _auto_resize
148- super ().__init__ ()
149-
150146 @property
151147 def description (self ) -> str :
152148 return (
@@ -167,7 +163,7 @@ def expected_components(self) -> List[ComponentSpec]:
167163
168164 @property
169165 def inputs (self ) -> List [InputParam ]:
170- return [InputParam ("image" )]
166+ return [InputParam ("image" ), InputParam ( "_auto_resize" , type_hint = bool , default = True ) ]
171167
172168 @property
173169 def intermediate_outputs (self ) -> List [OutputParam ]:
@@ -195,7 +191,8 @@ def __call__(self, components: FluxModularPipeline, state: PipelineState):
195191 img = images [0 ]
196192 image_height , image_width = components .image_processor .get_default_height_width (img )
197193 aspect_ratio = image_width / image_height
198- if self ._auto_resize :
194+ _auto_resize = block_state ._auto_resize
195+ if _auto_resize :
199196 # Kontext is trained on specific resolutions, using one of them is recommended
200197 _ , image_width , image_height = min (
201198 (abs (aspect_ratio - w / h ), w , h ) for w , h in PREFERRED_KONTEXT_RESOLUTIONS
0 commit comments