Style reference chips with thumbnails
This commit is contained in:
+3
-2
@@ -182,12 +182,13 @@ class DumasH3SequencePromptBuilder:
|
||||
)
|
||||
selectors = []
|
||||
for reference_index in range(1, 10):
|
||||
tag = f"R{reference_index}"
|
||||
chunks = []
|
||||
for chunk_index, clip in enumerate(sequence["clips"], start=1):
|
||||
text = "\n".join(str(slot.get("text", "")) for slot in clip["slots"])
|
||||
if kwargs.get(f"reference_image_{reference_index}") is not None and re.search(
|
||||
rf"@{tag}(?![A-Za-z0-9_])", text, re.IGNORECASE
|
||||
rf"@(R{reference_index}|image{reference_index})(?![A-Za-z0-9_])",
|
||||
text,
|
||||
re.IGNORECASE,
|
||||
):
|
||||
chunks.append(chunk_index)
|
||||
selectors.append(",".join(map(str, chunks)) or "off")
|
||||
|
||||
Reference in New Issue
Block a user