You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce code duplication for [pro] and [max], rename Pro and Max to [pro] and [max] to be consistent with other BFL nodes, make default seed for Kontext nodes be 1234. since 0 is interpreted by API as 'choose random seed' (#8337)
Edits images using Flux.1 Kontext Max via api based on prompt and resolution.
419
+
Edits images using Flux.1 Kontext [max] via api based on prompt and aspect ratio.
417
420
"""
418
421
419
-
MINIMUM_RATIO=1/4
420
-
MAXIMUM_RATIO=4/1
421
-
MINIMUM_RATIO_STR="1:4"
422
-
MAXIMUM_RATIO_STR="4:1"
423
-
424
-
@classmethod
425
-
defINPUT_TYPES(s):
426
-
return {
427
-
"required": {
428
-
"prompt": (
429
-
IO.STRING,
430
-
{
431
-
"multiline": True,
432
-
"default": "",
433
-
"tooltip": "Prompt for the image generation - specify what and how to edit.",
434
-
},
435
-
),
436
-
"aspect_ratio": (
437
-
IO.STRING,
438
-
{
439
-
"default": "16:9",
440
-
"tooltip": "Aspect ratio of image; must be between 1:4 and 4:1.",
441
-
},
442
-
),
443
-
"guidance": (
444
-
IO.FLOAT,
445
-
{
446
-
"default": 3.0,
447
-
"min": 0.1,
448
-
"max": 99.0,
449
-
"step": 0.1,
450
-
"tooltip": "Guidance strength for the image generation process"
451
-
},
452
-
),
453
-
"steps": (
454
-
IO.INT,
455
-
{
456
-
"default": 50,
457
-
"min": 1,
458
-
"max": 150,
459
-
"tooltip": "Number of steps for the image generation process"
460
-
},
461
-
),
462
-
"seed": (
463
-
IO.INT,
464
-
{
465
-
"default": 0,
466
-
"min": 0,
467
-
"max": 0xFFFFFFFFFFFFFFFF,
468
-
"control_after_generate": True,
469
-
"tooltip": "The random seed used for creating the noise.",
470
-
},
471
-
),
472
-
"prompt_upsampling": (
473
-
IO.BOOLEAN,
474
-
{
475
-
"default": False,
476
-
"tooltip": "Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation, but results are nondeterministic (same seed will not produce exactly the same result).",
477
-
},
478
-
),
479
-
},
480
-
"optional": {
481
-
"input_image": (IO.IMAGE,),
482
-
},
483
-
"hidden": {
484
-
"auth_token": "AUTH_TOKEN_COMFY_ORG",
485
-
"comfy_api_key": "API_KEY_COMFY_ORG",
486
-
"unique_id": "UNIQUE_ID",
487
-
},
488
-
}
489
-
490
-
@classmethod
491
-
defVALIDATE_INPUTS(cls, aspect_ratio: str):
492
-
try:
493
-
validate_aspect_ratio(
494
-
aspect_ratio,
495
-
minimum_ratio=cls.MINIMUM_RATIO,
496
-
maximum_ratio=cls.MAXIMUM_RATIO,
497
-
minimum_ratio_str=cls.MINIMUM_RATIO_STR,
498
-
maximum_ratio_str=cls.MAXIMUM_RATIO_STR,
499
-
)
500
-
exceptExceptionase:
501
-
returnstr(e)
502
-
returnTrue
503
-
504
-
RETURN_TYPES= (IO.IMAGE,)
505
-
DESCRIPTION=cleandoc(__doc__or"") # Handle potential None value
0 commit comments