Categories
Tutorials

RealVisXL, CFG Scale and Sampling Steps Sweet Spot

If your goal is to generate photorealistic images of people using the RealVisXL model, then here’s what I got for you.

When I first used RealVisXL with the default CFG scale of 7, I wondered why all my photos looked so weird.

Then, I realized that RealVisXL comfort zone lies in the 1-3 CFG scale value, for photorealistic images.

Here are some experiments using Automatic1111 and realvisxlV30Turbo_v30TurboBakedvae. No refiner.

Here’s a pattern that we can observe with sampler: DPM++ SDE Karras.

  • When Steps = 1, no images are usable.
  • The higher the steps, the more likely your image will not be corrupted as you raise CFG scale.
  • Steps provide more detail on the face. but can become blotchy and ugly if overdone.

Take a look:

Steps = 6

Steps = 11

Everything is sharper at steps = 11 and the image has more contrast.

What about steps = 16?

Everything is even sharper, but facial imperfections start to look blotchy and unrealistic. The sharpness of that hair is also very unrealistic.

Hair would not be that sharp if this image were taken with a camera. The back would be a bit blurry.

I felt that steps = 16 was beyond the “sweet spot”, especially since more steps mean more time spent to generate.

Further Optimizing CFG-Steps Scale in RealVisXL

With the grid above, I concluded that the sweet spot for steps and CFG is,

  • Steps = between 6 and 11
  • CFG = 1-7

You can run your own CFG scale tests using these tips.

CFG 1-7 and Steps 6-11

Let’s do another run with a more specific CFG and Steps plot.

On the right of the red line are images that have artifacts and therefore are unusable.

At all steps, there are usable images. However, these images start becoming unusable once you cross a CFG scale.

For images with 6 steps, that threshold is CFG 4.

For images with 10 or 11 steps, that threshold is CFG 5.

Conclusion: RealVisXL is best used with CFG 1-3 and steps between 6 to 11. Keeping your settings within these parameters will mean you will get realistic shots most of the time.

Samples at CFG 2, Steps 6

Portrait of a couple in a garden with flowers smiling during summer
Negative prompt: naked, nude, cleavage
Steps: 6, Sampler: DPM++ SDE Karras, CFG scale: 2, Seed: 3706236851, Size: 832×1216, Model hash: cfab6aec06, Version: v1.7.0

european castle during sunset
Negative prompt: naked, nude, cleavage
Steps: 6, Sampler: DPM++ SDE Karras, CFG scale: 2, Seed: 995587713, Size: 1024×1024, Model hash: cfab6aec06, Version: v1.7.0

red convertible car with driver smiling on the streets of london during summer
Negative prompt: naked, nude, cleavage
Steps: 6, Sampler: DPM++ SDE Karras, CFG scale: 2, Seed: 3618610045, Size: 1024×1024, Model hash: cfab6aec06, Version: v1.7.0

cartoon illustration of a woman running away from a monster
Negative prompt: naked, nude, cleavage
Steps: 6, Sampler: DPM++ SDE Karras, CFG scale: 2, Seed: 564701369, Size: 1024×1024, Model hash: cfab6aec06, Version: v1.7.0

space with a spaceship flying earth in the background
Negative prompt: naked, nude, cleavage
Steps: 6, Sampler: DPM++ SDE Karras, CFG scale: 2, Seed: 2984696454, Size: 1024×1024, Model hash: cfab6aec06, Version: v1.7.0

many people dancing in the night club having fun smiling drinking
Negative prompt: naked, nude, cleavage
Steps: 6, Sampler: DPM++ SDE Karras, CFG scale: 2, Seed: 2705768479, Size: 1024×1024, Model hash: cfab6aec06, Version: v1.7.0

Have a project in mind?

Websites. Graphics. SEO-oriented content.

I can get your next project off the ground.

See how I have helped my clients.