@@ -294,6 +294,49 @@ def generate_image(self, prompt, image_size, width, height, num_images, safety_t
294
294
print (f"Error generating image with FluxPro 1.1: { str (e )} " )
295
295
return self .create_blank_image ()
296
296
297
+ class FluxUltra :
298
+ @classmethod
299
+ def INPUT_TYPES (cls ):
300
+ return {
301
+ "required" : {
302
+ "prompt" : ("STRING" , {"default" : "" , "multiline" : True }),
303
+ "aspect_ratio" : (["21:9" , "16:9" , "4:3" , "1:1" , "3:4" , "9:16" , "9:21" ], {"default" : "16:9" }),
304
+ "num_images" : ("INT" , {"default" : 1 , "min" : 1 , "max" : 1 }),
305
+ "safety_tolerance" : (["1" , "2" , "3" , "4" , "5" , "6" ], {"default" : "2" }),
306
+ "enable_safety_checker" : ("BOOLEAN" , {"default" : True }),
307
+ "raw" : ("BOOLEAN" , {"default" : False }),
308
+ "sync_mode" : ("BOOLEAN" , {"default" : False }),
309
+ },
310
+ "optional" : {
311
+ "seed" : ("INT" , {"default" : - 1 }),
312
+ }
313
+ }
314
+
315
+ RETURN_TYPES = ("IMAGE" ,)
316
+ FUNCTION = "generate_image"
317
+ CATEGORY = "FAL/Image"
318
+
319
+ def generate_image (self , prompt , aspect_ratio , num_images , safety_tolerance , enable_safety_checker , raw , sync_mode , seed = - 1 ):
320
+ arguments = {
321
+ "prompt" : prompt ,
322
+ "aspect_ratio" : aspect_ratio ,
323
+ "num_images" : num_images ,
324
+ "safety_tolerance" : safety_tolerance ,
325
+ "enable_safety_checker" : enable_safety_checker ,
326
+ "raw" : raw ,
327
+ "sync_mode" : sync_mode
328
+ }
329
+ if seed != - 1 :
330
+ arguments ["seed" ] = seed
331
+
332
+ try :
333
+ handler = submit ("fal-ai/flux-pro/v1.1-ultra" , arguments = arguments )
334
+ result = handler .get ()
335
+ return self .process_result (result )
336
+ except Exception as e :
337
+ print (f"Error generating image with FluxUltra: { str (e )} " )
338
+ return self .create_blank_image ()
339
+
297
340
class FluxLora :
298
341
@classmethod
299
342
def INPUT_TYPES (cls ):
@@ -558,7 +601,7 @@ def create_blank_image(self):
558
601
return (img_tensor ,)
559
602
560
603
# Add common methods to all classes
561
- for cls in [FluxPro , FluxDev , FluxSchnell , FluxPro11 , FluxGeneral , FluxLora , Recraft ]:
604
+ for cls in [FluxPro , FluxDev , FluxSchnell , FluxPro11 , FluxUltra , FluxGeneral , FluxLora , Recraft ]:
562
605
cls .process_result = process_result
563
606
cls .create_blank_image = create_blank_image
564
607
@@ -568,6 +611,7 @@ def create_blank_image(self):
568
611
"FluxDev_fal" : FluxDev ,
569
612
"FluxSchnell_fal" : FluxSchnell ,
570
613
"FluxPro11_fal" : FluxPro11 ,
614
+ "FluxUltra_fal" : FluxUltra ,
571
615
"FluxGeneral_fal" : FluxGeneral ,
572
616
"FluxLora_fal" : FluxLora ,
573
617
"Recraft_fal" : Recraft
@@ -579,6 +623,7 @@ def create_blank_image(self):
579
623
"FluxDev_fal" : "Flux Dev (fal)" ,
580
624
"FluxSchnell_fal" : "Flux Schnell (fal)" ,
581
625
"FluxPro11_fal" : "Flux Pro 1.1 (fal)" ,
626
+ "FluxUltra_fal" : "Flux Ultra (fal)" ,
582
627
"FluxGeneral_fal" : "Flux General (fal)" ,
583
628
"FluxLora_fal" : "Flux LoRA (fal)" ,
584
629
"Recraft_fal" : "Recraft V3 (fal)"
0 commit comments