3030 Flux2VaeEncoderStep ,
3131)
3232from .inputs import (
33- Flux2ImageInputStep ,
3433 Flux2TextInputStep ,
3534)
3635
3736
38- class Flux2AutoTextInputStep (AutoPipelineBlocks ):
39- block_classes = [Flux2TextInputStep ]
40- block_names = ["text_input" ]
41- block_trigger_inputs = [None ]
42-
43- @property
44- def description (self ):
45- return (
46- "Text input step that processes text embeddings and determines batch size.\n "
47- " - `Flux2TextInputStep` is always used."
48- )
49-
50-
51- class Flux2AutoImageInputStep (AutoPipelineBlocks ):
52- block_classes = [Flux2ImageInputStep ]
53- block_names = ["image_input" ]
54- block_trigger_inputs = ["image_latents" ]
55-
56- @property
57- def description (self ):
58- return (
59- "Image input step that expands image latents to match batch size.\n "
60- " - `Flux2ImageInputStep` is used when `image_latents` is provided.\n "
61- " - Skipped when no image conditioning is used."
62- )
63-
64-
6537logger = logging .get_logger (__name__ ) # pylint: disable=invalid-name
6638
6739
@@ -100,21 +72,6 @@ def description(self):
10072 )
10173
10274
103- class Flux2AutoTextEncoderStep (AutoPipelineBlocks ):
104- block_classes = [Flux2RemoteTextEncoderStep , Flux2TextEncoderStep ]
105- block_names = ["remote" , "local" ]
106- block_trigger_inputs = ["remote_text_encoder" , None ]
107-
108- @property
109- def description (self ):
110- return (
111- "Text encoder step that generates text embeddings to guide the image generation.\n "
112- "This is an auto pipeline block that selects between local and remote text encoding.\n "
113- " - `Flux2RemoteTextEncoderStep` is used when `remote_text_encoder=True`.\n "
114- " - `Flux2TextEncoderStep` is used otherwise (default)."
115- )
116-
117-
11875Flux2BeforeDenoiseBlocks = InsertableDict (
11976 [
12077 ("prepare_latents" , Flux2PrepareLatentsStep ()),
@@ -135,53 +92,25 @@ def description(self):
13592 return "Before denoise step that prepares the inputs for the denoise step in Flux2 generation."
13693
13794
138- class Flux2AutoBeforeDenoiseStep (AutoPipelineBlocks ):
139- model_name = "flux2"
140- block_classes = [Flux2BeforeDenoiseStep ]
141- block_names = ["before_denoise" ]
142- block_trigger_inputs = [None ]
143-
144- @property
145- def description (self ):
146- return (
147- "Before denoise step that prepares the inputs for the denoise step.\n "
148- "This is an auto pipeline block for Flux2.\n "
149- " - `Flux2BeforeDenoiseStep` is used for both text-to-image and image-conditioned generation."
150- )
151-
152-
153- class Flux2AutoDenoiseStep (AutoPipelineBlocks ):
154- block_classes = [Flux2DenoiseStep ]
155- block_names = ["denoise" ]
156- block_trigger_inputs = [None ]
157-
158- @property
159- def description (self ) -> str :
160- return (
161- "Denoise step that iteratively denoises the latents. "
162- "This is an auto pipeline block that works for Flux2 text-to-image and image-conditioned tasks."
163- " - `Flux2DenoiseStep` (denoise) for text-to-image and image-conditioned tasks."
164- )
165-
166-
167- class Flux2AutoDecodeStep (AutoPipelineBlocks ):
168- block_classes = [Flux2DecodeStep ]
169- block_names = ["decode" ]
170- block_trigger_inputs = [None ]
171-
172- @property
173- def description (self ):
174- return "Decode step that decodes the denoised latents into image outputs.\n - `Flux2DecodeStep`"
95+ AUTO_BLOCKS = InsertableDict (
96+ [
97+ ("text_encoder" , Flux2TextEncoderStep ()),
98+ ("text_input" , Flux2TextInputStep ()),
99+ ("vae_image_encoder" , Flux2AutoVaeEncoderStep ()),
100+ ("before_denoise" , Flux2BeforeDenoiseStep ()),
101+ ("denoise" , Flux2DenoiseStep ()),
102+ ("decode" , Flux2DecodeStep ()),
103+ ]
104+ )
175105
176106
177- AUTO_BLOCKS = InsertableDict (
107+ REMOTE_AUTO_BLOCKS = InsertableDict (
178108 [
179- ("text_encoder" , Flux2AutoTextEncoderStep ()),
180- ("text_input" , Flux2AutoTextInputStep ()),
181- ("image_encoder" , Flux2AutoVaeEncoderStep ()),
182- ("image_input" , Flux2AutoImageInputStep ()),
183- ("before_denoise" , Flux2AutoBeforeDenoiseStep ()),
184- ("denoise" , Flux2AutoDenoiseStep ()),
109+ ("text_encoder" , Flux2RemoteTextEncoderStep ()),
110+ ("text_input" , Flux2TextInputStep ()),
111+ ("vae_image_encoder" , Flux2AutoVaeEncoderStep ()),
112+ ("before_denoise" , Flux2BeforeDenoiseStep ()),
113+ ("denoise" , Flux2DenoiseStep ()),
185114 ("decode" , Flux2DecodeStep ()),
186115 ]
187116)
@@ -221,7 +150,6 @@ def description(self):
221150 ("preprocess_images" , Flux2ProcessImagesInputStep ()),
222151 ("vae_encoder" , Flux2VaeEncoderStep ()),
223152 ("prepare_image_latents" , Flux2PrepareImageLatentsStep ()),
224- ("image_input" , Flux2ImageInputStep ()),
225153 ("prepare_latents" , Flux2PrepareLatentsStep ()),
226154 ("set_timesteps" , Flux2SetTimestepsStep ()),
227155 ("prepare_rope_inputs" , Flux2RoPEInputsStep ()),
@@ -234,4 +162,5 @@ def description(self):
234162 "text2image" : TEXT2IMAGE_BLOCKS ,
235163 "image_conditioned" : IMAGE_CONDITIONED_BLOCKS ,
236164 "auto" : AUTO_BLOCKS ,
165+ "remote" : REMOTE_AUTO_BLOCKS ,
237166}
0 commit comments