asagi4 / comfyui-prompt-control

ComfyUI nodes for prompt editing and LoRA control

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FR]: Allow for separate G/L prompts in PromptToSchedule for SDXL

DrJKL opened this issue · comments

This needs a bit of refactoring I think, but shouldn't be too difficult

I worked around this by encoding only a text_l and doing ConditioningConcat with the prompt schedule, which has the primary (g) prompt. It seems to work OK.

That said, I agree that a PromptToSchedule that was cognizant of both l and g encoders would be nice to have.

I added a way to separate the prompts. I tested it pretty lightly, but it seems to work.

I think it might break if weights are used inside the CLIP_L(), e.g. CLIP_L(cartoon, (colorful:0.5))

Hm, you're correct about that. It's because I use a simple regexp to find the "functions" from the prompt instead of properly parsing things.

It might be as simple as adding a lazy quantifier mod: https://www.pythontutorial.net/python-regex/python-regex-non-greedy/

Or if you ever end up switching to a parser, feel free to steal what I've got in https://github.com/DrJKL/prompt-crafter/blob/main/src/common/parsing/sdprompt.ne

I haven't had time to add the time-based stuff there (unwrapping prompt-control based on a given number of steps into discrete prompts, for example)

I already use a parser made with lark for most things, but I'm not that good at using lark so fiddling with the parser is always a bit painful and for the "function" syntax I just went with a simpler solution.

Anyway I made #22 about the parsing bug since this one is technically closed.