feat: support multiple reference images with model-aware API mapping
Replace singular reference_image field with reference_images list to support an arbitrary number of reference images. Map them to the correct BFL API parameter names based on model family: - flux-2-*: input_image, input_image_2, ..., input_image_8 - flux-kontext-*: input_image, input_image_2, ..., input_image_4 - flux 1.x: image_prompt (single) BREAKING CHANGE: reference_image config field renamed to reference_images (list).
This commit is contained in:
parent
b69c38ac13
commit
d565329e16
8 changed files with 112 additions and 23 deletions
|
|
@ -91,7 +91,7 @@ class TestCollectHelpers:
|
|||
"out.png": {
|
||||
"prompt": "x",
|
||||
"inputs": ["input.txt"],
|
||||
"reference_image": "ref.png",
|
||||
"reference_images": ["ref.png"],
|
||||
"control_images": [],
|
||||
}
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ class TestCollectHelpers:
|
|||
"prompt": "x",
|
||||
"width": 512,
|
||||
"height": 256,
|
||||
"reference_image": "ref.png",
|
||||
"reference_images": ["ref.png"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ class TestCollectHelpers:
|
|||
params = _collect_extra_params("out.png", config)
|
||||
assert params["width"] == 512
|
||||
assert params["height"] == 256
|
||||
assert params["reference_image"] == "ref.png"
|
||||
assert params["reference_images"] == ("ref.png",)
|
||||
|
||||
def test_collect_extra_params_empty(self, write_config: WriteConfig) -> None:
|
||||
config = write_config({"targets": {"out.txt": {"prompt": "x"}}})
|
||||
|
|
@ -131,7 +131,7 @@ class TestCollectHelpers:
|
|||
"out.png": {
|
||||
"prompt": "x",
|
||||
"inputs": ["a.txt"],
|
||||
"reference_image": "ref.png",
|
||||
"reference_images": ["ref.png"],
|
||||
"control_images": ["c1.png", "c2.png"],
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue