asagi4 / comfyui-prompt-control

ComfyUI nodes for prompt editing and LoRA control
GNU General Public License v3.0
200 stars 16 forks source link

Embedding alt syntax does not work #24

Closed ahoeppner closed 9 months ago

ahoeppner commented 9 months ago

Thanks for the hard work making this project, it's amazing.

I noticed when I tried to use the alt syntax for embeddings, <emb:xyz>, i would be returned:

[ERROR] PromptControl: Prompt editing parse error: Error trying to process rule "embedding":

'str' object has no attribute 'value'

I was able to fix the error by modifying the embedding() function to:

def embedding(self, args):
        return "embedding:" + args[0]

I believe omitting the .value property works because the function is trying to access a value attribute on a string object, which does not exist. I don't know if this is the correct fix, or if the embedding() function is intended to be passed something else other than a string.

EDIT: embedding weighting doesn't work with my solution, but doing like <emb:xyz:0.5> doesn't seem to work for me with the deployed version either, so I'm not sure what the right approach is.

asagi4 commented 9 months ago

<emb:foo:N> has never worked, though maybe I should make it work because it is easy to think it should work given the LoRA syntax.