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
|
||||
prompt_chunks = chunk_prompt_for_clip(prompt)
|
||||
|
||||
# Create a prompt entry for each chunk
|
||||
for i, chunk in enumerate(prompt_chunks):
|
||||
if len(prompt_chunks) > 1:
|
||||
# If we have multiple chunks, add a chunk identifier
|
||||
chunked_prompt = f"{player[0]}_chunk_{i+1}:{chunk}"
|
||||
else:
|
||||
chunked_prompt = f"{player[0]}:{chunk}"
|
||||
prompts.append(chunked_prompt)
|
||||
# Use the first chunk (most important part) for image generation
|
||||
# This ensures each player generates exactly one image
|
||||
final_prompt = prompt_chunks[0] if prompt_chunks else prompt
|
||||
prompts.append(f"{player[0]}:{final_prompt}")
|
||||
|
||||
except KeyError as e:
|
||||
logging.warning(f"Key error while generating prompt for player: {e}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user