@@ -141,6 +141,45 @@ def generate_image(self, prompt, image_size, num_inference_steps, num_images, en
141
141
print (f"Error generating image with FluxSchnell: { str (e )} " )
142
142
return self .create_blank_image ()
143
143
144
+ class FluxPro11 :
145
+ @classmethod
146
+ def INPUT_TYPES (cls ):
147
+ return {
148
+ "required" : {
149
+ "prompt" : ("STRING" , {"default" : "" , "multiline" : True }),
150
+ "image_size" : (["square_hd" , "square" , "portrait_4_3" , "portrait_16_9" , "landscape_4_3" , "landscape_16_9" ], {"default" : "landscape_4_3" }),
151
+ "num_images" : ("INT" , {"default" : 1 , "min" : 1 , "max" : 10 }),
152
+ "safety_tolerance" : (["1" , "2" , "3" , "4" , "5" , "6" ], {"default" : "2" }),
153
+ },
154
+ "optional" : {
155
+ "seed" : ("INT" , {"default" : - 1 }),
156
+ "sync_mode" : ("BOOLEAN" , {"default" : False }),
157
+ }
158
+ }
159
+
160
+ RETURN_TYPES = ("IMAGE" ,)
161
+ FUNCTION = "generate_image"
162
+ CATEGORY = "FAL"
163
+
164
+ def generate_image (self , prompt , image_size , num_images , safety_tolerance , seed = - 1 , sync_mode = False ):
165
+ arguments = {
166
+ "prompt" : prompt ,
167
+ "image_size" : image_size ,
168
+ "num_images" : num_images ,
169
+ "safety_tolerance" : safety_tolerance ,
170
+ "sync_mode" : sync_mode
171
+ }
172
+ if seed != - 1 :
173
+ arguments ["seed" ] = seed
174
+
175
+ try :
176
+ handler = submit ("fal-ai/flux-pro/v1.1" , arguments = arguments )
177
+ result = handler .get ()
178
+ return self .process_result (result )
179
+ except Exception as e :
180
+ print (f"Error generating image with FluxPro 1.1: { str (e )} " )
181
+ return self .create_blank_image ()
182
+
144
183
# Common methods for all classes
145
184
def process_result (self , result ):
146
185
images = []
@@ -166,20 +205,22 @@ def create_blank_image(self):
166
205
return (img_tensor ,)
167
206
168
207
# Add common methods to all classes
169
- for cls in [FluxPro , FluxDev , FluxSchnell ]:
208
+ for cls in [FluxPro , FluxDev , FluxSchnell , FluxPro11 ]:
170
209
cls .process_result = process_result
171
210
cls .create_blank_image = create_blank_image
172
211
173
212
# Node class mappings
174
213
NODE_CLASS_MAPPINGS = {
175
214
"FluxPro_fal" : FluxPro ,
176
215
"FluxDev_fal" : FluxDev ,
177
- "FluxSchnell_fal" : FluxSchnell
216
+ "FluxSchnell_fal" : FluxSchnell ,
217
+ "FluxPro11_fal" : FluxPro11
178
218
}
179
219
180
220
# Node display name mappings
181
221
NODE_DISPLAY_NAME_MAPPINGS = {
182
222
"FluxPro_fal" : "Flux Pro (fal)" ,
183
223
"FluxDev_fal" : "Flux Dev (fal)" ,
184
- "FluxSchnell_fal" : "Flux Schnell (fal)"
224
+ "FluxSchnell_fal" : "Flux Schnell (fal)" ,
225
+ "FluxPro11_fal" : "Flux Pro 1.1 (fal)"
185
226
}
0 commit comments