[Stable Diffusion] Prompt Sharing and Learning Thread

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,802
To be honest -- even if you had made a mistake along the way, it's still a great guide and I think everyone gets the steps you're doing to get the optimal result! Great guide, bookmarked! :-D

And btw: if you know a decent "Custom Node" which would let me do something like that in ComfyUI (like selecting multiple checkpoints, running the same prompt, getting a comparison picture as a result; same for different samplers and CFG values etc.) that would be awesome. It's something I always wanted to do more easily, right now I'm doing this kind of manual and creating those images by pasting single images into a larger picture one by one -- which is OK to get an overview, but not great if you want to do this for a new prompt.
No unfortunately I'm a stubborn boneheaded type that has refused so far to give in to the spagetti lord almighty.
Sepheyer is however well deep into that particular "sect" and can probably help you out, me3 might be the grand masters holy prophet himself and can probably provide some guidance on the path to pasta kingdom too.. :D
 

Sepheyer

Well-Known Member
Dec 21, 2020
1,571
3,768
To be honest -- even if you had made a mistake along the way, it's still a great guide and I think everyone gets the steps you're doing to get the optimal result! Great guide, bookmarked! :-D

And btw: if you know a decent "Custom Node" which would let me do something like that in ComfyUI (like selecting multiple checkpoints, running the same prompt, getting a comparison picture as a result; same for different samplers and CFG values etc.) that would be awesome. It's something I always wanted to do more easily, right now I'm doing this kind of manual and creating those images by pasting single images into a larger picture one by one -- which is OK to get an overview, but not great if you want to do this for a new prompt.
I trust you know there are a few grid nods, but indeed they are all pretty crappy for a variety of reasons. If you don't know that there are grid nods at all, let us know and we'll hook you up.
 

felldude

Active Member
Aug 26, 2017
572
1,695
1.jpg

Testings the arguments above, Im not sure I'll get the .01 loss I am looking for but we will see


No unfortunately I'm a stubborn boneheaded type that has refused so far to give in to the spagetti lord almighty.
Sepheyer is however well deep into that particular "sect" and can probably help you out, me3 might be the grand masters holy prophet himself and can probably provide some guidance on the path to pasta kingdom too.. :D
Weren't you doing training with command line and writing .py and yaml, you should have given in to spaghetti lord a long time ago :)
 
Last edited:
  • Haha
Reactions: DD3DD and Mr-Fox

devilkkw

Member
Mar 17, 2021
323
1,093
Some consideration after 2 week of CUI experiment, for who want try it after using a1111.

First of all understanding how CUI work is the point. There are different approach from a1111 and someone get "scared" about node connection, but here and online you find good workflow for start.

Another important thing is don't think put prompt in CUI with same embedding and lora get same result's as a1111. NO!

For what i see CUI is really bad (or better, your choice) in positional argument. Positive and Negative indeed.
Moving an embedding, lora, or a simple word is a game change, so if your prompt work in a1111, don't mean work in same way on CUI.

Also balancing embedding and lora is pain in the ass, you really need experiment and find correct position and weight of every embedding/lora you push in.

I know there are many user here using CUI from almost time, and they have surely better knowledge on it, this is some consideration i found using CUI.

A little trick for consistent prompting:
Enclose your prompt and little weight it all give better result in mostly case!
For example, this prompt:

beautiful blonde (afro:1.2) woman bathing in a river, cinematic shot, (embedding:horror), other embedding

transformed is:
((beautiful blonde (afro:1.2) woman bathing in a river, cinematic shot, (embedding:horror)):1.01), other embedding

note the double "((" at strat and enclose "):1.01)" at the end, also embedding:horror is a style embedding i want applied on the image, so i enclose it, then other embedding for composition (like detailer) get out of it.

With these trick i get consistent result without washing out full composition loading embedding and lora.

Maybe you also know it, but is good to keep in mind.

And now a question: is there a way to copy group nodes from a workflow to another? i didn't find it.
 

felldude

Active Member
Aug 26, 2017
572
1,695
I ended up at .05 instead of .067 with the same number of epochs (Cosine vs Cosine Annealing)

Still has to many anomaly's to enter the in my opinion.

ComfyUI_01481_.png
 
  • Like
Reactions: devilkkw and Mr-Fox

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,802
View attachment 3304621

Testings the arguments above, Im not sure I'll get the .01 loss I am looking for but we will see




Weren't you doing training with command line and writing .py and yaml, you should have given in to spaghetti lord a long time ago :)
I had no idea I could write .py or yaml. I wish someone had told me..:LOL:
It would have been very useful many times probably..:geek:
 

felldude

Active Member
Aug 26, 2017
572
1,695
I had no idea I could write .py or yaml. I wish someone had told me..:LOL:
It would have been very useful many times probably..:geek:
If you read and then change a variable in the line I posted above about using the CosineAnnealingLR then you will have written .py

--lr_scheduler_type "CosineAnnealingLR" --lr_scheduler_args "T_max=1" "eta_min=1e-4" "verbose=True"

And if you are a cuck then you have probably eaten pie...also I have been drinking...a lot

Before I blackou...sleep if your using koyaha you can paste the line here:

3.jpg


eta_min can be set as low as zero, per the pytorch doc
 
Last edited:
  • Thinking Face
Reactions: Mr-Fox

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,802
If you read and then change a variable in the line I posted above about using the CosineAnnealingLR then you will have written .py

--lr_scheduler_type "CosineAnnealingLR" --lr_scheduler_args "T_max=1" "eta_min=1e-4" "verbose=True"

And if you are a cuck then you have probably eaten pie...also I have been drinking...a lot

Before I blackou...sleep if your using koyaha you can paste the line here:

View attachment 3304862


eta_min can be set as low as zero, per the pytorch doc
Yeah I'll let this one slide since you're drunk, but don't ever call me "cuck" or anything similar again..
 
  • Haha
Reactions: felldude and DD3DD

me3

Member
Dec 31, 2016
316
708
Some consideration after 2 week of CUI experiment, for who want try it after using a1111.

First of all understanding how CUI work is the point. There are different approach from a1111 and someone get "scared" about node connection, but here and online you find good workflow for start.

Another important thing is don't think put prompt in CUI with same embedding and lora get same result's as a1111. NO!

For what i see CUI is really bad (or better, your choice) in positional argument. Positive and Negative indeed.
Moving an embedding, lora, or a simple word is a game change, so if your prompt work in a1111, don't mean work in same way on CUI.

Also balancing embedding and lora is pain in the ass, you really need experiment and find correct position and weight of every embedding/lora you push in.

I know there are many user here using CUI from almost time, and they have surely better knowledge on it, this is some consideration i found using CUI.

A little trick for consistent prompting:
Enclose your prompt and little weight it all give better result in mostly case!
For example, this prompt:

beautiful blonde (afro:1.2) woman bathing in a river, cinematic shot, (embedding:horror), other embedding

transformed is:
((beautiful blonde (afro:1.2) woman bathing in a river, cinematic shot, (embedding:horror)):1.01), other embedding

note the double "((" at strat and enclose "):1.01)" at the end, also embedding:horror is a style embedding i want applied on the image, so i enclose it, then other embedding for composition (like detailer) get out of it.

With these trick i get consistent result without washing out full composition loading embedding and lora.

Maybe you also know it, but is good to keep in mind.

And now a question: is there a way to copy group nodes from a workflow to another? i didn't find it.
There are different prompt interpreters in comfyui, one of which copies the one used in a1111.

There's also nodes that setup settings etc to be the same or close to a1111.

Another thing is that by default a1111 uses GPU for things like seed/randomness, comfy default is CPU. You can change this in both UIs and you can see there can be a very large difference between the two options. Comfy can do this on a per sampler node basis if you used the correct one.

Regarding prompting, i haven't used a1111 for XL and not checked the code, but i believe it still dumps the same prompt into both text encoders, there's people that argue this the absolute way of doing it, but if you try feeding different prompting styles or just parts of the prompt to each encoder you quickly see that you can use this to your advantage.
I really don't think ppl should lock themselves too much into one style or way of writing prompts, that will quickly turn into the mess ppl just keep dumping into their negatives.

Creativity is "freedom".
 

me3

Member
Dec 31, 2016
316
708
Been testing some detailing (and upscaling).
First image is just detailing parts of the image, in this case the woman and armor, while leaving the background untouched.
Second image is a iterative upscaling with very low and decreasing denoising. The background becomes very "busy", and when testing there was cases where it became almost oversaturated because the colors became rather heavy/dominating.

Looks like it might be more masks needed in the future...if only there was better mask editors in the UIs....

maskdet_00001_.jpg maskdet_00002_.jpg
You don't have permission to view the spoiler content. Log in or register now.
 

Sepheyer

Well-Known Member
Dec 21, 2020
1,571
3,768
Been testing some detailing (and upscaling).
First image is just detailing parts of the image, in this case the woman and armor, while leaving the background untouched.
Second image is a iterative upscaling with very low and decreasing denoising. The background becomes very "busy", and when testing there was cases where it became almost oversaturated because the colors became rather heavy/dominating.

Looks like it might be more masks needed in the future...if only there was better mask editors in the UIs....

View attachment 3307430 View attachment 3307429
You don't have permission to view the spoiler content. Log in or register now.
Please, can you post the workflow? I see this looks like image-2-image, or at least an OpenPose. Still, interested to see how iterative upscale was done.
 
  • Like
Reactions: DD3DD

me3

Member
Dec 31, 2016
316
708
Please, can you post the workflow? I see this looks like image-2-image, or at least an OpenPose. Still, interested to see how iterative upscale was done.
Will have to finish the current run first at least. Apparently heunpp seem to run HORRIBLY slow on SDXL, it didn't seem that bad on SD1.5...
Be warned though, it's a nice mess as it's not just those nodes. Might gives those noodle haters nightmare, so i guess there's an upside :p

Edit, trying to post a workflow image but forum won't let me, it's too big...*sigh*
 
Last edited:
  • Haha
Reactions: Mr-Fox and DD3DD

devilkkw

Member
Mar 17, 2021
323
1,093
There are different prompt interpreters in comfyui, one of which copies the one used in a1111.

There's also nodes that setup settings etc to be the same or close to a1111.

Another thing is that by default a1111 uses GPU for things like seed/randomness, comfy default is CPU. You can change this in both UIs and you can see there can be a very large difference between the two options. Comfy can do this on a per sampler node basis if you used the correct one.

Regarding prompting, i haven't used a1111 for XL and not checked the code, but i believe it still dumps the same prompt into both text encoders, there's people that argue this the absolute way of doing it, but if you try feeding different prompting styles or just parts of the prompt to each encoder you quickly see that you can use this to your advantage.
I really don't think ppl should lock themselves too much into one style or way of writing prompts, that will quickly turn into the mess ppl just keep dumping into their negatives.

Creativity is "freedom".
Very interesting, i saw sampler code and some difference are on it. But i'm not so skilled to understand every line of code, just i like see different approach to get good result.

Speaking by code, i made a mod for CUI dynamic prompt nodes, related to trick i posted yesterday( entire prompt weight).

Also made a fork and pull request on GitHub, but i'm not sure how it work because is first time i use fork and pull request.

So mod is simply, added a weight to node if weight is 1 nothing appen and you get standard prompt (see result in "Show text" node):
mod-dyn.prompt-2.jpg-w.jpg

But if you go up with weight, all prompt is automatically enclose and weighted:
mod-dyn.prompt-1.jpg-w.jpg
Maybe this is useless for someone, but for experimenting is good, i think.

Also about XL, i tested on a1111 v1.7 and in CUI, but i don't like XL so my test was fast, just for see if XL work.
Also in a1111 i switched back to 1.5.2, the only version don't cause memory problem on standard sd1.5 model.

Maybe in a future i'll try XL better, or wait some other update better than XL.
 

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,957
Learn ComfyUi part one of a series by Olivio Sarikas:

Sepheyer and me3, also a couple more are our local ComfyUi experts. I'm sure they will help you also.

Who knows me and Jim might be persuaded to give it a go also. I know that I for one is intrigued and curious about it but out of boneheaded-ness not taken the plunge yet. ;)
Thanks man! Found the time to work through the tutorial now. Needed to watch other ones for the installation first, but then went with your link. I set up a basic workflow with 3 different outputs. It works faster and smoother than A1 did in my memory, and personally I think the nodes and cables are waaaaay more fun.

When I copied the output windows two times (the 4 in a row) it for whatever reason did not connect some of the cables, but those that were missing were marked with a red circle. So I connected them again manually, I find that this visual cue is pretty nice and it shows that they thought about a good UX (at least so far).

I am not at how to use upscalers yet, but this is what my sessions looks like right now. I've been working with other software before, that also makes use of complex routings and modules / nodes, so working this way feels like home for me. And like I said, it's a lot of fun! Feels more personal than the clunky A1 UI.

1706573279869.png
 
Last edited:

me3

Member
Dec 31, 2016
316
708
May I ask where do you get that "show text" node?
Anyone knows how to use refiner in CUI, I haven't found that but I think there is a work around
I watch CUI on Youtube channel of Scott... while he had a series, I wish he made it more organized, like txt2img, img2img, IPAdapter, controlnet,...
If you have the manager installed, search for a node pack called "Comfyui custom scripts", it's made by someone named "pythongosssss" (might be a few s more or less). It has a bunch of useful nodes and other features.

As for refiner, if you're referring to the SDXL "second" model that was released along with the base, most other SDXL models don't used it, but you can use that and any model as "top finishing layer". There are some sampler nodes that has a input for sampler and a ratio setting for how many of the steps to use with just the refiner. I can't remember specifically atm as there's SO MANY sampler nodes.
Other option is to use 2 samplers then you can run the first for like 15 step and the second for 10. Some samplers have the option to set number of steps, start and end step, so if you set number of steps to 40, start at 0 and end at 25 in the first sampler, then 40, 25 and 40 in the second.
This is just one way to do it and these numbers are just picked and it's just one more thing you can figure out what works best for your prompt etc, but it might give you a hint how.
 

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,957
Thanks man! Found the time to work through the tutorial now. Needed to watch other ones for the installation first, but then went with your link. I set up a basic workflow with 3 different outputs. It works faster and smoother than A1 did in my memory, and personally I think the nodes and cables are waaaaay more fun.

When I copied the output windows two times (the 4 in a row) it for whatever reason did not connect some of the cables, but those that were missing were marked with a red circle. So I connected them again manually, I find that this visual cue is pretty nice and it shows that they thought about a good UX (at least so far).

I am not at how to use upscalers yet, but this is what my sessions looks like right now. I've been working with other software before, that also makes use of complex routings and modules / nodes, so working this way feels like home for me. And like I said, it's a lot of fun! Feels more personal than the clunky A1 UI.

View attachment 3307890

Unfortunately my computer still sometimes (not always) shuts off when I am using the upscaler. But now because of the nodes I can see where it exactly happens.. it's on the very last second when the upscaled picture reached 99% and would finally appear in the image view node / being saved on the computer.

Really weird. I thought previously it might have been a hardware related issue, but this seems like it crashes when SD tries to finalize/create the file.
 
  • Like
Reactions: Sepheyer

Sepheyer

Well-Known Member
Dec 21, 2020
1,571
3,768
Unfortunately my computer still sometimes (not always) shuts off when I am using the upscaler. But now because of the nodes I can see where it exactly happens.. it's on the very last second when the upscaled picture reached 99% and would finally appear in the image view node / being saved on the computer.

Really weird. I thought previously it might have been a hardware related issue, but this seems like it crashes when SD tries to finalize/create the file.
You can troubleshoot it yet further - rather than saving to file you can keep the workflow at the preview level.

I trust you know, the CUI goes:

  1. prompt ->
  2. encode into latent ->
  3. latent manupulation (including upscale which is also a manipulation) ->
  4. decode latent into pixels ->
  5. preview (or/and save) ->
  6. pixel upscale (optoinal)

I think the most hardcore piece is #4 as it is the most demanding. I.e. you can safely juggle large latents but the decoding it into pixels is the true bottleneck. So, you can crop your workflow where it never gets to decode to test if the shutdowns continue.

Naturally, may be as you said the shutdowns take place strictly during saving. Then do disable the saving node and test the workflow again. If shutdowns stop, then you'll know there is something wrong with the actual input-output and might want to try workarounds.