mirror of
https://github.com/karl0ss/comfy_fm24_newgens.git
synced 2025-10-03 06:40:06 +01:00
fixed text chunking
This commit is contained in:
parent
61ddf2f2aa
commit
36ff97e44a
@ -250,14 +250,10 @@ def generate_prompts_for_players(players, app_config):
|
|||||||
# Chunk the prompt if it's too long for CLIP
|
# Chunk the prompt if it's too long for CLIP
|
||||||
prompt_chunks = chunk_prompt_for_clip(prompt)
|
prompt_chunks = chunk_prompt_for_clip(prompt)
|
||||||
|
|
||||||
# Create a prompt entry for each chunk
|
# Use the first chunk (most important part) for image generation
|
||||||
for i, chunk in enumerate(prompt_chunks):
|
# This ensures each player generates exactly one image
|
||||||
if len(prompt_chunks) > 1:
|
final_prompt = prompt_chunks[0] if prompt_chunks else prompt
|
||||||
# If we have multiple chunks, add a chunk identifier
|
prompts.append(f"{player[0]}:{final_prompt}")
|
||||||
chunked_prompt = f"{player[0]}_chunk_{i+1}:{chunk}"
|
|
||||||
else:
|
|
||||||
chunked_prompt = f"{player[0]}:{chunk}"
|
|
||||||
prompts.append(chunked_prompt)
|
|
||||||
|
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
logging.warning(f"Key error while generating prompt for player: {e}")
|
logging.warning(f"Key error while generating prompt for player: {e}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user