[Stable Diffusion] Prompt Sharing and Learning Thread

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,955
In all my years (okay, year singular) using Stable Diffusion I have never heard of such a thing. And there is no such thing as generating without a starting seed either. You may not have used the same seed as whatever source prompt you got, but there is always a seed, it's what allows the generation of the initial noise field from which the image is created.
Yeah it seems that was just a lucky shot. Trying further it still crashes with fresh "projects" and also with other upscalers. Hmmm, very annoying.
 

hkennereth

Member
Mar 3, 2019
237
775
Yeah it seems that was just a lucky shot. Trying further it still crashes with fresh "projects" and also with other upscalers. Hmmm, very annoying.
I blame A1111. I could barely ever make more than a few images with it without it crashing or cease responding for some unknown reason or another. It's just a bad piece of software. ComfyUI has surely a much steeper initial learning curve, but it's rock solid, never freezes, never crashes, and it's faster, and it handles images much, much larger.
 
  • Like
Reactions: Fuchsschweif

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,955
I blame A1111. I could barely ever make more than a few images with it without it crashing or cease responding for some unknown reason or another. It's just a bad piece of software. ComfyUI has surely a much steeper initial learning curve, but it's rock solid, never freezes, never crashes, and it's faster, and it handles images much, much larger.
Yeah I actually thought of just switchting and trying comfyUI instead.. I like the node-approach too! Since SD is the only thing that causes issues on my computer I also blame A1111 rn. It usually otherwise never crashes, not when I play games or work with heavy editing programs.
 

me3

Member
Dec 31, 2016
316
708
bluescreenviewer points at the RAM, which I find odd, since RAM isn't really much used with SD is it?

View attachment 3011784

caused by "ntoskrnl.exe+41270"

:/
There's quite a few things that would cause RAM to get used some of them can easily use over 32gb of ram.
Since you probably aren't using SDXL, the more likely things causing it is that you're technically triggering OOM when you're upscaling. Which is very easy to do if you aren't paying attention. However your graphics drivers are "compensating" by offloading from VRAM to RAM. This generally causes a noticeable slow down though depending on when it happens. Most likely time is the last few steps in the upscaling when it hits things like vae and at that time you'll only notice it if you're looking at the system resource usage or by the last couple of percentages taking much longer to finish.

Depending on your settings you could also be storing previously used checkpoints in RAM. This is to speed up if you keep changing between different checkpoints. How many checkpoints are kept there depends on how many you've set, so that could eat quite a lot of RAM
 

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,955
There's quite a few things that would cause RAM to get used some of them can easily use over 32gb of ram.
Since you probably aren't using SDXL, the more likely things causing it is that you're technically triggering OOM when you're upscaling. Which is very easy to do if you aren't paying attention. However your graphics drivers are "compensating" by offloading from VRAM to RAM. This generally causes a noticeable slow down though depending on when it happens. Most likely time is the last few steps in the upscaling when it hits things like vae and at that time you'll only notice it if you're looking at the system resource usage or by the last couple of percentages taking much longer to finish.

Depending on your settings you could also be storing previously used checkpoints in RAM. This is to speed up if you keep changing between different checkpoints. How many checkpoints are kept there depends on how many you've set, so that could eat quite a lot of RAM
Is there a way to check any of this in the settings? Resource monitor didn't show that my ram went full (I think 5 out of 16gb were in usage iirc). But it definitely happens after the upscaler kicks in and progress slows down. I just don't know why it worked so well earlier but not anymore. I didn't switch between checkpoints or VAE's since earlier.
 

me3

Member
Dec 31, 2016
316
708
I blame A1111. I could barely ever make more than a few images with it without it crashing or cease responding for some unknown reason or another. It's just a bad piece of software. ComfyUI has surely a much steeper initial learning curve, but it's rock solid, never freezes, never crashes, and it's faster, and it handles images much, much larger.
Only times i've had a1111 freeze is when running it on a 1050 with 2gb of vram and half of that gets used by the OS.
That isn't to say that the optimizing potential for A LOT of things isn't massive.
Specially when it comes to the "highres fix"...
Even on my 6gb vram i can easily batch 8 512x images using just 4gb so i could have gotten more if i "fixed" their setup. I can almost batch 6 1024x too, but using highres fix to "upscale" a single image OOM at around just 1500px...
 

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,955
I think I will just dive into comfyUI tomorrow. The node system is cool and more control sounds good, and by learning ComfyUI I learn more about how SD works within the single steps. It's probably a great visual way of seeing modules working together rather than just reading an article that explains what happens under the hood.

Many people now said that comfyui also performs better and I am on a 1070, so.. I don't want to give my computer many more shutdowns, even if nothing happened yet, not worth the risk.

Does ComfyUI run on a web version too or can I run that completely locally?
 

me3

Member
Dec 31, 2016
316
708
Is there a way to check any of this in the settings? Resource monitor didn't show that my ram went full (I think 5 out of 16gb were in usage iirc). But it definitely happens after the upscaler kicks in and progress slows down. I just don't know why it worked so well earlier but not anymore. I didn't switch between checkpoints or VAE's since earlier.
Keep your task manager open and look at the GPU output, It should show you graphs both for the VRAM and shared memory. IF usage for the shared memory goes up when the upscaling starts or towards the end, it's likely what's causing you issues.

That being said, even if it's overflowing into RAM usage you shouldn't be blue screening without some other issue. This could easily be an issue with faulty RAM, since there's a lot of RAM issue you won't notice unless it hits a certain usage percentage. Also it could be a issue with your graphics card, but less likely. Should check the temp on it just to be sure as it's fairly high load on is known to cause a fair bit of temp increase
 
  • Like
Reactions: Fuchsschweif

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,802
Is there a way to check any of this in the settings? Resource monitor didn't show that my ram went full (I think 5 out of 16gb were in usage iirc). But it definitely happens after the upscaler kicks in and progress slows down. I just don't know why it worked so well earlier but not anymore. I didn't switch between checkpoints or VAE's since earlier.
If you are limited to 16Gb of ram I will perhaps suggest the obvious thing here. As soon as you can afford it, invest in 2 pair more sticks. I did and it has been tremendous. It will help the rest of your hardware have a longer reach until you can invest in a better GPU. Perhaps this is the reason I'm able to use SDXL checkpoints, not sure of this though. SD 1.5 doesn't like to go as high as 1024px but SDXL does. So you have more detail to work with right from the start. This makes the next step bring way more sharpness and detail than if you started out with 512px. But if SDXL is out of reach try 768x768 first, next is 960x960. Use the one that your pc can deal with. Then use hiresfix and adjust the multiplier until you get out of memory error. Ok now you know your limit within txt2img. Next go to img2img and use SD upscale and see how much you can get from this.
The big difference between hirefix and upscale with SD Upscale is that the later are using tiles when upscaling. This means your GPU only has to deal with a smaller image at a time. When you use SD Upscale the resolution in img2img tab becomes the tiles size adjustment and the multiplier and the size of the sample image decides the end resolution. SO you can achieve 4k and much more with a limited hardware if you simply adjust the tile size. Next option is of course to use photoshop to get more sharpness and detail with "smart sharpness" filter and the camera raw filter.
 
Last edited:
  • Like
Reactions: Fuchsschweif

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,955
Should check the temp on it just to be sure as it's fairly high load on is known to cause a fair bit of temp increase
Already did that, it never goes over 65°C. CPU is also verrry bored. I didn't look at the VRAM usage specifically yet. But..

If you are limited to 16Gb of ram I will perhaps suggest the obvious thing here. As soon as you can afford it, invest in 2 pair more sticks. I did and it has been tremendous.
... since I ever saw my main ram usage yet while running SD at 5 out of 16gb, I doubt that it's due to overloaded ram that the VRAM handled over.

Anyways.. if I will run into the same issues with comfyUI it will most likely be something in my setup. But I doubt it, since all other programs run very well, even those with high demands, especially in terms of RAM. I work with post processing programs in other fields that sometimes consume my ram up to 90% without any crashes.
 
  • Like
Reactions: Mr-Fox

Mr-Fox

Well-Known Member
Jan 24, 2020
1,401
3,802
Hiresfix is very demanding on the video memory and it's very easy to run out and get oom error. I have done it a bunch until I learned to not push it and instead use other options. Let's suppose you can generate a portrait ratio image of 640x960, then uspcale 2x with hiresfix. You now have 1280x1920. Send it over to img2img. Instead of using the 1280x1920 when upscaling, set it to 640x960 because this slider is the tile size when using SD Upscale. Set the upscale multiplier to 3 or 4 if you so wish.
In the end you will have 3840x5760 because the upscaler will multiplie the image 3 times not the tile. Hope it makes sense. SD Upscale script will calculate how many tiles and batches that is required. The sample steps also will increase the detail and sharpness so use at least double the amount of steps to what the txt2img sample steps were. If yo used 30 then use 60 in img2img.
 
Last edited:

Fuchsschweif

Well-Known Member
Sep 24, 2019
1,145
1,955
In the end you will have 3840x5760 because the upscaler will multiplie the image 3 times not the tile. Hope it makes sense. SD Upscale script will calculate how many tiles and batches that is required. The sample steps also will increase the detail and sharpness so use at least double the amount of steps to what the txt2img sample steps was. If yo used 30 then use 60 in img2img.
Is it quality wise the same output just done more efficient, or is the SD script a bit inferior compared to hiresfix?
 

Jimwalrus

Well-Known Member
Sep 15, 2021
1,045
3,994
Apropos the discussion around Upscalers, I've run some comparisons, using 3 Upscalers I've used before and one that has always just given terrible results*.
There are 20 images in total - 4 just using each Upscaler in HiRes fix (45 sampling steps, 60 Hires steps, denoising 0.33), then I ran each of those four images through 3x Upscaling in Extras for each of the four Upscalers.

N.B. These images are intended to be as 'photo-realistic' as possible, other "hyper-realism" or cartoon styles may give very different results.
I had ADetailer set for both face and hands, there's also kkw-skindet in the embeddings too.

*ESRGAN_4x, 4x-UltraSharp, 4xNMKDSuperscale & R-ESRGAN 4x+. The latter is terrible for photo-realism.

Looking at them, my personal preference seems to be either ESRGAN_4x for HiRes fix then 4xNMKDSuperscale for upscaling in Extras or 4xNMKDSuperscale for both.

The finished images are too large to upload direct, so a RAR.

The initial Hires fixed images are below:
4xNMKDSuperscale_4xNMKDSuperscale-3698910456.png 4x-UltraSharp-3698910456.png ESRGAN_4x-3698910456.png R-ESRGAN 4x+-3698910456.png

N.B. For some reason, 4xNMKDSuperscale shows in my A1111 as "4xNMKDSuperscale_4xNMKDSuperscale". I've no idea why, but I've kept it in the filenames for completeness
 
  • Red Heart
Reactions: Mr-Fox and Sepheyer

Sepheyer

Well-Known Member
Dec 21, 2020
1,571
3,768
Did you look into IPAdapter? This is just something that I learned about 2 seconds ago, yet I am strongly convinced this is the way forward rather than LORAs. Sorry I don't have anything to backup my words with other than my enormous enthusiasm for IPA after the few videos that I saw. I am slowly making my way towards amending the workflow to incorporate IPA, and should be there "soon" but not at this moment.

Among multiple videos about IPA here is the one that kinda sold me: on the idea. Note, that CUI's IPA has a unique implementation where you can add noise to the image prompt. Whoa! So noise! Much image!
 
  • Like
Reactions: Mr-Fox

me3

Member
Dec 31, 2016
316
708
Did you look into IPAdapter? This is just something that I learned about 2 seconds ago, yet I am strongly convinced this is the way forward rather than LORAs. Sorry I don't have anything to backup my words with other than my enormous enthusiasm for IPA after the few videos that I saw. I am slowly making my way towards amending the workflow to incorporate IPA, and should be there "soon" but not at this moment.

Among multiple videos about IPA here is the one that kinda sold me: on the idea. Note, that CUI's IPA has a unique implementation where you can add noise to the image prompt. Whoa! So noise! Much image!
according to their own words it won't work well with facial details. It will work for it but it'll apparently not handle "fine details" so that kind defeats much of the purpose and as such it'll fail as a replacement.
It also seems to be dependent on controlnet which makes me wonder about memory needs and compatibility and you actually need to train it "in a different way" which for me raises question about actually having the system for it.

Edit:
It also seems to purely be "replacement" which in no way will replace the point of loras and there's already a selection of those things
 
Last edited:
  • Like
Reactions: Mr-Fox

Sepheyer

Well-Known Member
Dec 21, 2020
1,571
3,768
according to their own words it won't work well with facial details. It will work for it but it'll apparently not handle "fine details" so that kind defeats much of the purpose and as such it'll fail as a replacement.
It also seems to be dependent on controlnet which makes me wonder about memory needs and compatibility and you actually need to train it "in a different way" which for me raises question about actually having the system for it.

Edit:
It also seems to purely be "replacement" which in no way will replace the point of loras and there's already a selection of those things
It is a "latent replacement". More like "latent injection", which is really pretty cool. And in one form or another this will eventually provide some augmentation to the textual prompting. On the other hand the "plus" model handles 16 tokens (or was it eight?) so that makes me go hmm wondering if this is enough. Like, IDK how much a token represents, but I'd think to represent a face one needs a few thousand.
 
  • Like
Reactions: Mr-Fox