Giter Club home page Giter Club logo

Comments (12)

andreszs avatar andreszs commented on June 21, 2024

Please spare my ignorance, but exactly why would you insert "#" anywhere in the prompt for that matter?

from comfyui.

Meizr avatar Meizr commented on June 21, 2024

Please spare my ignorance, but exactly why would you insert "#" anywhere in the prompt for that matter?

I'd also like to know it. I think it's just a hashtag, like those used in social media posts. (that image wasn't generated by me)
I've updated the post with more details.

from comfyui.

NeedsMoar avatar NeedsMoar commented on June 21, 2024

I can't recall what square brackets were supposed to do... were they implicit downweighting like how () upweights slightly?

from comfyui.

NeedsMoar avatar NeedsMoar commented on June 21, 2024

According to the community manual [] doesn't do anything in prompts. Downweighting is via () with a number less than 1 specified. [] did downweighting in shark, so the equivalent would be (foo:0.9)

Maybe try that and see if it works? It's possible [] used to downweight and was dropped.

from comfyui.

Meizr avatar Meizr commented on June 21, 2024

I can't recall what square brackets were supposed to do... were they implicit downweighting like how () upweights slightly?

I couldn't find an official explanation for what square brackets do in Comfyui.

I was assuming it was decreasing attention for the enclosed expression, but when testing with (David Fincher:-1.10) and other values, I couldn't reproduce that same picture. I didn't included this test in issues' description because I don't really know what square brackets are doing here.
But removing them from the prompt causes an almost identical image.

from comfyui.

NeedsMoar avatar NeedsMoar commented on June 21, 2024

I just did a once-over on the conditioning parser. [] do nothing.

from comfyui.

NeedsMoar avatar NeedsMoar commented on June 21, 2024

The only thing I can think of is that they were being stripped out before... they don't seem to be now, so they could just be literal [] in the final prompt.

from comfyui.

Meizr avatar Meizr commented on June 21, 2024

According to the community manual [] doesn't do anything in prompts. Downweighting is via () with a number less than 1 specified. [] did downweighting in shark, so the equivalent would be (foo:0.9)

Maybe try that and see if it works? It's possible [] used to downweight and was dropped.

Thanks for your reply. I had thought about that as well: that [] was downweighting in older buillds, but I didn't mention it because I could find nothing about it.

I had tried using () with different values, but all results are nowhere near the reference image (generated with the older build). All images remain consistent with what the current build generates (front and side of the car can be seen).

Take a look what I get vs what I should get:

image

I tried also escaping square bracket by using [ EXPRESSION ] , with no success

The next step is using comfyui files from newer build with whole python from the older. I'll do that later.

from comfyui.

Meizr avatar Meizr commented on June 21, 2024

Well, I've found out:

If I use the following prompt in the recent comfyui build:

car, filmed by ([David Fincher]:1), ancient, winter in space, a fairy tale

I can reproduce the image generated in older build.

Also, in older build I could get the exact same image by using "the alternate" syntax. Image is the same, comparared pixel by pixel.

Take a look at both results (older build, showing both sintaxes):

image

So:

this older build's "exclusive" syntax:
car, filmed by [David Fincher], ancient, winter in space, a fairy tale

is the same as newer (and also older!) build's

car, filmed by ([David Fincher]:1), ancient, winter in space, a fairy tale

I was testing for decimal values instead of 1, very confident it wasn't 1 after reaching more similar images, but then I realized the older build I'm using isn't deterministic (pytorch, and --deterministic argument isn't supported), so I switched to xformers and tested in older build, finally reaching the value of 1.

Now I know whether this change is an expected behaviour....

I remember seeing some commit about the change in [] in file paths, but nothing in prompts....

from comfyui.

NeedsMoar avatar NeedsMoar commented on June 21, 2024

How absolutely bizzarre...

All I can seem to find is that it has some meaning in ComfyUI-prompt-control custom nodes where it can do various things... most require specific syntax but one just means (I think) "not emphasized" which I suppose is equivalent to (foo bar:1)
!emphasized: "(" prompt? ")"
| "(" prompt ":" prompt ")"
| "[" prompt "]"
I'm guessing all it would do is treat the contained items as a single token for attention purposes where normally they'd be split and locality would be used. Did you try (David Fincher:1) to see if it does the same thing? @comfyanonymous could probably answer this but it's mostly academic I guess if you've found the workaround.

Any chance those were installed in the version you were using? You'll have a "Conditioning (Advanced)" node if it's around I think.

With other syntaxes it can also be used to schedule items contained in the square brackets for temporal weighting in batches

from comfyui.

Meizr avatar Meizr commented on June 21, 2024

All I can seem to find is that it has some meaning in ComfyUI-prompt-control custom nodes where it can do various things... most require specific syntax but one just means (I think) "not emphasized" which I suppose is equivalent to (foo bar:1) !emphasized: "(" prompt? ")" | "(" prompt ":" prompt ")" | "[" prompt "]" I'm guessing all it would do is treat the contained items as a single token for attention purposes where normally they'd be split and locality would be used.

Interesting.....

I had tried also using [Fincher], and ([Fincher]:1) yesterday, but in all tests, results were consistent with using a "compound" expression ("David Fincher").

I also did another very interesting test:

Using a clean and recent comfyui, I've copied comfyui files from 31_07_2023 build (so that embedded python would be from recent build), and square bracket behaviour was the one from NEWER builds.

So it seems it's something inside python (maybe torch and its dependencies) that's causing this difference.

At this point, maybe there's not much that can be done in comfyui's side.

Did you try (David Fincher:1) to see if it does the same thing? @comfyanonymous could probably answer this but it's mostly academic I guess if you've found the workaround.

I had tried, but it's different from both [prompt] and ([prompt]:1)

Also, (David Fincher:1) gives different results in both builds, but that's probably some change in attention thing...

See comparison below, newer and older builds:

Recent build:

recent build 3 - syntaxes

31_07_2023 build:

31_07_2023 build 3 - syntaxes

Any chance those were installed in the version you were using? You'll have a "Conditioning (Advanced)" node if it's around I think.

No, just checked, this node isn't here. My customnodes folder is currently without any third party node folder, and there's no "Conditioning (Advanced)" node available.

from comfyui.

Meizr avatar Meizr commented on June 21, 2024

I've found out what causes difference in behaviour:

It's the pair (pair because of dependency) transformers and tokenizers

With transformers 4.30.2 and tokenizers 0.13.3, [expression] is the same as ([expression]:1)

With transformers 4.39.3 and tokenizers 0.15.2, [expression] is different from ([expression]:1)

Maybe it's the tokenizers alone, but I can't confirm it due to dependency issues.

from comfyui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.