Young Knight [InsCode Stable Diffusion Photo Event Phase 1]

Young Knight [InsCode Stable Diffusion Photo Event Phase 1]


Have you experienced the explosive love map?

You can create your own works as you like without the ability of painting or photography!

But many people are discouraged from it because of the expensive hardware and cumbersome installation.

lnscode provides an environment for learning and using Stable Diffusion, has installed related software and component libraries, and can directly start Stable Diffusion WebUI for creation

Stable Diffusion model online use address

1. Online address of Stable Diffusion model:

https://inscode.csdn.net/@inscode/Stable-Diffusion

first picture

2. Model version and related configuration:

Model: primemix_v21.safetensors [b79a4f7283]

Sampling method (Sampler): DPM++ 2M Karras

Sampling iteration steps (steps): 28

Width: 521

Height: 768

Generate batches (Batch count): 1

Batch size: 1

Prompt Word Correlation (CFG Scale): 7

3. Picture prompts and reverse prompts:

Positive prompts:

official art, unity 8k wallpaper, (high detail), beautiful and aesthetic, masterpiece, best quality,realistic, mage, feathered fan, wind spell, mountain, hanfu Delicate Illumination, Soft Highlights, Understated Depth, <lora:JPKniji5 oc_v10:0.2> lora:LowRA:0.8 lora:CAMERALora_v20:0.6 lora:JPKKKKKK3dCGStyleRealistic_v10:0.3 lora:xiaorenshu:0.35,lightonface,cinemalights,professionallighting,photonmapping,radiosity,.

Reverse prompt test:

,wings,(Monotonous color:1.2),sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, (outdoor:1.6), manboobs, backlight,(ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.331), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (more than 2 nipples:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), bad hands, missing fingers,(Four fingers:1.331), (six fingers:1.331),(extra hand:1.331), (extra leg:1.4),extra digit, (Pseudo Niang:1.1),(Ladyboy:1.4) ,bad body,(Watermark:1.4) ,(An incoherent picture:1.2),(No logic:1.331),(Less hair:1.2),(A gloomy picture:1.1) ,NG_DeepNegative_V1_75T, glans, refraction, diffusion, diffraction, (worst quality, low quality:1.4)…

Seed: 258369

insert image description here

second picture

Model version and related configuration:

Model: primemix_v21.safetensors [b79a4f7283]

Sampling method (Sampler): DPM++ 2M Karras

Sampling iteration steps (steps): 35

Other settings are the same as Figure 1

Image prompts and reverse prompts:

正向提示词:(Clear face),Exquisite details,(Realistic clothing texture),Real ambient light,Clear skin texture,.Depth of Field, Scatter, Halo,Black Soft Filter, Nikon D850,Lens spot,VSCO,high-level,.Best quality, masterpiece,Photos, photography works, masterpieces, DHR, 8K,Complex details,High resolution, high detail RAW, wallpaper,Film texture,Real, (real person),.A handsome young man, Xiake, with an extremely long black ponytail and a red dot mark between his eyebrows. In the palace of the dark night, he fights against masked enemies in a battle posture, with the light of a torch illuminating the falling snowflakes. The long sword emits a faint silver white halo, and in movie stills, all body,.

反向提示词:watermark, painting, cartoons, sketch, (worst quality:2), (low quality:2), (normal quality:1), lowers, bad.anatomy, bad hands, ((monochrome)), ((grayscale)), ugly, duplicate, mutilated, extra fingers, mutated hands, poorly.drawn hands, mutation, bad anatomy, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing.arms, extra arms, extra legs, fused fingers, too many fingers, (nipples:1.5),Strange face,…

Seed: 258371

insert image description here

third picture

Model version and related configuration:

Model: primemix_v21.safetensors [b79a4f7283]

Sampling method (Sampler): DPM++ 2M Karras

Sampling iteration steps (steps): 35

Other settings are the same as Figure 1

Image prompts and reverse prompts:

正向提示词:(Clear face),Exquisite details,(Realistic clothing texture),Real ambient light,Clear skin texture,.Depth of Field, Scatter, Halo,Black Soft Filter, Nikon D850,Lens spot,VSCO,high-level,.Best quality, masterpiece,Photos, photography works, masterpieces, DHR, 8K,Complex details,High resolution, high detail RAW, wallpaper,Film texture,Real, (real person),.A handsome young man, Xiake, with an extremely long black ponytail and a red dot mark between his eyebrows. In the palace of the dark night, he fights against masked enemies in a battle posture, with the light of a torch illuminating the falling snowflakes. The long sword emits a faint silver white halo, and in movie stills, all body,.

反向提示词:watermark, painting, cartoons, sketch, (worst quality:2), (low quality:2), (normal quality:1), lowers, bad.anatomy, bad hands, ((monochrome)), ((grayscale)), ugly, duplicate, mutilated, extra fingers, mutated hands, poorly.drawn hands, mutation, bad anatomy, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing.arms, extra arms, extra legs, fused fingers, too many fingers, (nipples:1.5),Strange face,…

Seed: 258371

insert image description here

fourth picture

Model version and related configuration:

Model: primemix_v21.safetensors [b79a4f7283]

Sampling method (Sampler): DPM++ 2M Karras

Sampling iteration steps (steps): 35

Other settings are the same as Figure 1

Image prompts and reverse prompts:

正向提示词:(8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37),(feiwangzi,1boy),fly,building, castle, city, cityscape, cloud, cloudy_sky,standing,

反向提示词:(EasyNegative:1.2), ng_deepnegative_v1_75t, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), bad anatomy,(long hair:1.4),DeepNegative,(fat:1.2),facing away, looking away,tilted head,lowres,bad anatomy,bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worst quality, low quality, normal quality,jpegartifacts,signature, watermark, username,blurry,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,extra fingers,fewer digits,extra limbs,extra arms,extra legs,malformed limbs,fused fingers,too many fingers,long neck,cross-eyed,mutated hands,polar lowres,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,missing legs,extra digi

Seed: 258373

insert image description here

fifth picture

Model version and related configuration:

Model: primemix_v21.safetensors [b79a4f7283]

Sampling method (Sampler): DPM++ 2M Karras

Sampling iteration steps (steps): 35

Other settings are the same as Figure 1

Image prompts and reverse prompts:

正向提示词:(8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37),(3Drender,octane render),kai,1boy,solo,(upper body,night,standing,40 old)

反向提示词:(EasyNegative:1.2), ng_deepnegative_v1_75t, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), bad anatomy,(long hair:1.4),DeepNegative,(fat:1.2),facing away, looking away,tilted head,lowres,bad anatomy,bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worst quality, low quality, normal quality,jpegartifacts,signature, watermark, username,blurry,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,extra fingers,fewer digits,extra limbs,extra arms,extra legs,malformed limbs,fused fingers,too many fingers,long neck,cross-eyed,mutated hands,polar lowres,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,missing legs,extra digi,((holding_weapon,holding,weapon,sword))

Seed: 258376

insert image description here

Chapter 6 Figure

Model version and related configuration:

model: chilloutmix-Ni.safetensors[7234b76e42]

Sampling method (Sampler): DPM++ 2M Karras

Sampling iteration steps (steps): 50

Other settings are the same as Figure 1

Image prompts and reverse prompts:

正向提示词:Masterpiece, 1girl, close up, wear blue hanfu, Chinese Traditional cloth, ((holding a water sword,)) long black hair, hair braid, blue wave background, water effect, ink painting style, dynamic pose, battle pose

Reverse hint words: EasyNegativeV2, ng_deepnegative_v1_75t, (low_quality:1.4), (worst_quality:1.4), (badhandv4:1.1),collage, artist_name, signature, artist_logo, watermark

Seed: 258370

insert image description here

1. InsCode Stable Diffusion experience

1.1 The interface is very friendly

Follow the prompts to start the environment

insert image description here

1.2 A little experience

open Stable Diffusion WebUIinterface

insert image description here

Enter the positive words at the beginning of the article, the reverse words and other parameters are set as shown in the figure below to generate beautiful pictures

insert image description here

1.3 Experience

The generation speed is very fast haha, 老年机much faster than generating images locally

2. How to install Lora for Stable Diffusion in InsCode

Steps refer to How to install Lora for Stable Diffusion in InsCode

3. Stable Diffusion tuning basis

3.1 Model Selection

The data sets and labels used by the model are very important to the impact of the effect. Before using it, you must first understand the data source.

3.2 Stable Diffusion Model

Stable Diffusion models are suitable for generating images similar to photographs and artworks. Training based on the LAION dataset.

3.3 Introduction to Common Parameters

  • Prompt: A textual description of what you want to generate.
  • Negative prompt: Describe in words what you don't want in the image.
  • Sampling Steps: Diffusion models work by taking small steps from random Gaussian noise to an image that matches a cue. How many such steps should there be. More steps means smaller, more precise steps from noise to image. Increasing this directly increases the time it takes to generate the image. Diminishing returns, depending on the sampler.
  • Sampling method: Which sampler to use. Euler a (short for ancestral) produces a lot of diversity with a small number of steps, but makes small tweaks difficult. The non-ancestral samplers all produce essentially the same image as the number of steps increases, use LMS if you're not sure.
  • Batch count/n_iter: The number of groups of images generated each time. The number of images generated in one run is Batch count * Batch size.
  • Batch size: How many images are generated at the same time. Increasing this value improves performance, but you also need more VRAM. The total number of images is this value multiplied by the number of batches. Usually stay at 1 except for advanced cards like 4090.
  • CFG Scale (Category Free Guidance Scale): How well the image matches your cue. Increasing this value will result in an image closer to your cue (according to the model), but it also reduces the image quality somewhat. Can be offset with more sampling steps.
  • Width: The width of the image, in pixels. To increase this value, you need more video memory. Large-scale image consistency gets worse as resolution increases (model is trained on 512x512). Very small values ​​(such as 256 pixels) also reduce image quality. This value must be a multiple of 8.
  • Height: Image height.
  • Seed: The starting point of the random number. Keeping this value constant can generate the same (or almost the same, if xformers is enabled) image multiple times. No seed is inherently better than another, but a seed that previously produced good results will likely still produce good results if you vary your input parameters only slightly.

3.4 Sampling steps iteration steps

More iterations may result in better results, more detail and sharpening, but will result in longer generation times. In practice, the difference between 30 steps and 50 steps is almost indistinguishable.

Too many iterations can also be counterproductive, providing little improvement.

When performing image generation, under normal circumstances, a weaker noise reduction strength requires fewer iterations (this is determined by the working principle). You can change the settings in the settings to have the program execute exactly the number of iterations specified by the slider.

3.5 Samplers Sampler

At present, it is easy to use Euler, Euler a(more delicate), and DDIM.

Recommended Euler aand DDIM, recommended for beginnersEuler a

Euler aBe creative, different numbers of steps can produce different pictures. Turning the number of steps too high (>30) will not work better.

DDIMFast convergence, but relatively low efficiency, because it takes a lot of steps to get good results, suitable for redrawing

LMSand PLMSare Eulerderivatives of , which use a related but slightly different approach (averaging the past few steps to improve accuracy). About 30 steps can get stable results

PLMSis an effective LMS (classical method) that can better handle singularities in neural network structures

DPM2is an amazing method, it aims to improve DDIM with fewer steps to get good results. It needs to run denoising twice per step, which is about twice as fast as DDIM. But if you're experimenting with debugging prompt words, this sampler doesn't work very well

Euleris the simplest and therefore one of the fastest

3.6 CFG Scale prompt word correlation

cfg scaleis the degree of fit between the image and the prompt word, the higher the value, the greater the influence of the prompt word on the final generated result, and the higher the fit degree.

Too high CFG Scale manifests itself in harsh lines and over-sharpened images.

3.7 Pay attention to size

When the plot size is too wide, multiple subjects may appear in the plot.

To match the posture, the camera and the characters are not deformed. Sometimes qualifiers are needed. When there are many characters, the spatial relationship and prompt occlusion priority must be dealt with. Number of people->Character appearance->Environment style->Character status

Dimensions above 1024 may give undesired results! A small resolution + HD fix is ​​recommended (described below).

3.8 Highres. fix HD repair

Enabled by ticking the "Highres.fix" checkbox on the txt2img (Vincent figure) page.

By default, txt2img (vinson graph) produces very chaotic images at high resolutions. This option will make the model generate a small image first, and then expand the resolution of the image through img2img to achieve a high-definition large image effect.

3.9 Batch Count 与 Batch Size

  • Batch Count(生成批次)Specifies how many batches to generate in total.
  • Batch Size(每批数量)Specifies how many images are produced in parallel per batch.

A large batch size needs to consume a huge amount of video memory. If your graphics card does not have more than 12G of video memory, please do not adjust the Batch Size.

For a graphics card with a large video memory, generating one image at a time cannot fully utilize the computing capacity of the graphics card. At this time, you can Batch Sizeincrease the to fully squeeze the computing power.

3.10 Random Seed

In theory, the seed determines all the randomness involved in the model's generation of images.

The actual seed value is not important. It just initializes with a random initial value that defines the starting point of diffusion.

With the exact same parameters applied (e.g. Step, CFG, Seed, prompts), the resulting images should be identical. (without using xformersinterfering optimizers such as )

Different graphics cards may have different unexpected results due to their different microarchitectures. Mainly reflected in the GTX 10xx series graphics cards.

3.11 Denoising strength Noise reduction strength

Denoising strengthIt is only applied when img2img (image-generated image) or high-definition restoration, which represents the degree of change of the final generated image to the original input image content. By adjusting this value, you can reduce the impact on the style of painting, but it will also weaken the img2img ability. The higher the value, the lower the reference degree of AI to the original image (while increasing the number of iterations).

For image-generated images, low denoisingmeans correcting the original image, and high denoisingmeans that there is no great correlation with the original image. Generally speaking, the threshold is around 0.7. If it exceeds 0.7, it has nothing to do with the original image, and if it is below 0.3, it will be changed slightly.

In actual execution, the specific execution steps are Denoising strength * Sampling Steps.

Contents of the next chapter: How to write prompts for generating text from pictures

Off-site release
Nuggets: https://juejin.cn/post/7256302444387795005
51CTO: https://blog.51cto.com/u_15067771/6741182
Alipay Developer Community: https://open.alipay.com/portal/forum /post/131301015
Aliyun community: https://developer.aliyun.com/article/1276080
info community: https://xie.infoq.cn/article/d88497eb5644c10ea3dc82b47

Guess you like

Origin blog.csdn.net/u014096024/article/details/131756743