kohya-ss / kohya-ss/sd-scripts

Prompt was truncated with --weighted_caption

Open
#596 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

When using --weighted_caption, the prompt is truncated.

Caption examples,
(tag1:1.0), (tag2:0.5), (tag3:0.01) ... (tag30:0.04)
=> Truncated

But even I don't use parenthesis, --weighted_caption makes the prompt truncated.
tag1, tag2, tag3 ... tag30
=> Truncated

With the same prompts, if I don't use --weighted_caption, it's okay.
tag1, tag2, tag3 ... tag30
=> Okay

I think there is something different between get_weighted_text_embeddings and unweighted algorithm.
So I tried to increase max_embeddings_multiples, couldn't find.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported difference between --weighted_caption and the unweighted path with the example prompts. Read get_weighted_text_embeddings and inspect how max_embeddings_multiples is applied in each path. Done means weighted prompts of the demonstrated length are no longer truncated when the equivalent unweighted prompts are accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.