Text2Image

The first tab you open to in automatic1111 is the text2img tab. We will explore the basics of generating an image using text in automatic1111.

text2img

Stable Diffusion Checkpoint

A Stable diffusion checkpoint or Stable diffusion model is a pre-trained set of weights used to generate images of a particular style.

Choosing the right checkpoint depends on your desired creative outcome. For example, if you want a photorealistic landscape, you might choose "runwayml/stable-diffusion-v1-5," while for a dreamlike abstraction, you might choose "CompVis/stable-diffusion-v1-1."

text2imgmodel

Now let's compare the images generated with the same prompt but different models.

modelcomparison

Positive Prompt

An asian woman wearing a flower crown

Other Settings

Steps: 20
Sampler: DPM++ 2M Karras
Face Restoration: Codeformers
CFG scale: 7
Seed: 3888089208
Size: 1024x1024
Version: v1.6.0-2-g4afaaf8a

As you can see there are difference in style between the images.

Prompts

prompts

Positive Prompt

Positive prompts are the words that guide the Stable Diffusion towards your artistic vision. The more detailed your prompts are the better the image.

Negative Prompt

Negative prompts are like the total opposite of Positive prompts. They are the words which you tell the Stable Diffusion to not include in the image.

Below we can see the effect of using a negative prompt. The first image was generated without a negative prompt and the second one was generated with the word orange.

promptscomparison

Positive Prompt

An asian woman wearing a flower crown

Negative Prompt

Orange

Width & Height

Settings

This will be the size of the image that you're generating.

note :

  • You should set at least once side of your image as 512px or more when using a v1 model.

Examples

1024x15361536x1024
Alt textAlt text

Sampling method

There are lots of samplers in automatic1111, but we prefer using DMP++2M Karras because it is efficient and produces quality images. For more information about samplers check this document(Work in progress).

Batch

batch

Automatic1111 allows modifying both batch size and batch count independently. Increasing batch size or count can lead to higher memory usage.

Batch size

The Batch size refers to the number of images to generate each time you run the image generation pipeline.

Batch count

The Batch count refers to the number of times you run the image generation pipeline.

batchsize

CFG

In Automatic1111, "CFG" stands for Classifier-Free Guidance. It's a parameter that controls how much the generated image matches your prompts.

Low CFG

  • When you use a low CFG for your image generation, the model has more freedom to deviate from your prompts. Which can lead to the generation of creative or chaotic images.
  • But using a low CFG also means that the model will ignore your prompts mostly or entirely.
low_cfg
CFG: 1

Positive Prompt

An asian woman wearing a flower crown

Here we can see that the generated image is only slightly adhered to given prompt. It also has some creativity to it like having flowers all over the image and not just the head(crown).

High CFG

  • When you use a high CFG for you image generation, the model strictly adheres to the prompt given by you. This provides more control and predictability, especially for photorealistic or specific artistic styles.
  • Using high CFG will also bottle the creativity and freedom of your model and will only follow the prompt that you have provided.
high_cfg
CFG: 30

Positive Prompt

An asian woman wearing a flower crown

In the above example we got an image matching to our prompt. But it is very plain and washed out.

tip :

  • We recommend using a CFG value that is not to high or not too low. So, that the generated image will stick to the prompt and also has some creative juice to it.

  • For example, CFG: 7.

Seed

A seed is the key that initializes the noise for image generation, influencing the initial arrangement of pixels. Each generated image has it's own seed value. Automatic1111 will use random seed values if its set to -1.

You can reuse a particular seed if you want to enhance it or tweak it more.

To check the seed of the image, check the log message under the generated image.

seedinfo To reuse a seed you have to just click the recycle button

seedsets

Now let us reuse a seed and modify the existing generated image.

info Seed: 3888089208

seedbeforeseedafter
Prompt: An asian woman wearing a flower crownPrompt: An asian woman wearing a flower crown, necklace

Other Settings

Steps: 20
Sampler: DPM++ 2M Karras
Face Restoration: Codeformers
CFG scale: 7
Size: 1024x1024
Model hash: 31e35c80fc
Model: sd_xl_base_1.0
Version: v1.6.0-2-g4afaaf8a

Here you can see that I have reused the seed and just added necklace to the prompt to generate the same image of the woman with a necklace.

Extra seed options

Automatic1111 offers some more settings for the seeds.

extraseeds

Variation seed

Variation seed is nothing but an additional seed. Let's say you want to blend two images of different seed value. Here's where variation seed comes into play.

**Variation strength: ** At 0, the generated image will resemble your original seed entirely. At 1, the generated image will resemble your variational seed.

For example, we have two images with different seeds

imagewithseed7imagewithseed10
Seed: 7Seed: 10

Now let's create a blend of these two images. To start, let's keep the seed as 7 and variation seed as 10. As we adjust the variation strength between 0 and 1. we will be able to produce a transition image between the two images.

imagewithstrength0imagewithstrength0.33imagewithstrength0.66imagewithstrength1
Var. Strength: 0Var. Strength: 0.33Var. Strength: 0.66Var. Strength: 1

In the above example we can see that the girl’s pose and background change gradually when the variation strength increases from 0 to 1.

Resize seed from width and height

When you try to resize a image with the same seed value in automatic 1111, we get an image that is totally different from the original one which we wanted to resize.

originalimageresizedimg
1024x10241024x1536

Positive Prompt

An asian woman wearing a flower crown

Other Settings

Steps: 20
Sampler: DPM++ 2M Karras
Face Restoration: Codeformers
CFG scale: 7
Seed: 2966918846
Size: 1024x1024
Version: v1.6.0-2-g4afaaf8a

We can see that the resized image is totally different from our original image. How do we fix that?

This is where we use the resize from width and height. The generated image might not be an exact resized copy of the original image but something closer to it.

originalimage

To resize the image you have to put the dimensions in which you need the resized image to be in the width and height. In the Resize seed from width and height you have to put in the dimensions of the original image which you want to resize.

originalimageresizedimage
1024x10241024x1536

We can see that the resized image is not exactly the same as the original image. But, the pose and background is similar to the original image.