<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > SD - Stable Diffusion AI > SDL. - Stable Diffusion Local System > SDL. - Image to Image |
MiniRobotLanguage (MRL)
SDL. - Image to Image
Use an provided Image and change it using AI.
Intention
Here are all supported Parameters for Img2Img, using SDL. and the Automatic1111-API.
'***********************************
' SDL.-Sample
'***********************************
' Sample Script that shows how to use these Parameters.
$$PRO=hero,propaganda (0.6),epic,russia(0.4),sexy
$$EXT=
$$EXT+"prompt": "$$PRO",
$$EXT+"denoising_strength": 0.75,
$$EXT+"image_cfg_scale": 4,
$$EXT+"batch_size": 2,
$$EXT+"n_iter": 3,
$$EXT+"steps": 70,
$$EXT+"cfg_scale": 7,
$$EXT+"width": 512,
$$EXT+"height": 512,
$$EXT+"restore_faces": true,
$$EXT+"tiling": false,
SDL.Set Extra Parameter|$$EXT
$$IMG=?exeloc\TP01.jpg
$$TAR=?exeloc\TP02.png
SDL.Img2Img|$$IMG|$$TAR
SDL.Show Error
'MBT.No File generated.
ENR.
-->
Parameter |
Default Value |
Value Range |
Explanation |
init_images |
["string"] |
Array of strings |
Initial image(s) for the model Base64 encoded |
resize_mode |
0 |
Integer |
Mode for resizing images, •0: Just Resize •1: Crop and Resize •2: Resize and Fill |
denoising_strength |
0.75 |
0.0 - 1.0 |
Strength of denoising filter, higher means more AI Influence in the result |
image_cfg_scale |
0 |
Integer |
Scale configuration for image |
mask |
"string" |
String |
Mask applied to the image Base64 encoded |
mask_blur |
0 |
Integer |
Amount of blur applied to mask |
mask_blur_x |
4 |
Integer |
X-axis blur for mask |
mask_blur_y |
4 |
Integer |
Y-axis blur for mask |
inpainting_fill |
0 |
Integer |
Fill value for inpainting |
inpaint_full_res |
true |
Boolean |
Whether inpainting is done at full resolution |
inpaint_full_res_padding |
0 |
Integer |
Padding for inpainting at full resolution |
inpainting_mask_invert |
0 |
Integer |
Inversion of inpainting mask |
initial_noise_multiplier |
0 |
Integer |
Multiplier for initial noise |
prompt |
"" |
String |
Text prompt for the model |
styles |
["string"] |
Array of strings |
Styles applied to the model |
seed |
-1 |
Integer |
Random seed |
subseed |
-1 |
Integer |
Subseed for randomization |
subseed_strength |
0 |
Integer |
Strength of subseed effect |
seed_resize_from_h |
-1 |
Integer |
Seed resize height |
seed_resize_from_w |
-1 |
Integer |
Seed resize width |
sampler_name |
"string" |
String |
Name of the sampling algorithm |
batch_size |
1 |
Integer |
Number of images processed in a batch |
n_iter |
1 |
Integer |
Number of iterations |
steps |
50 |
Integer |
Number of steps for the algorithm |
cfg_scale |
7 |
Integer |
Configuration scale |
width |
512 |
Integer |
Width of the output image |
height |
512 |
Integer |
Height of the output image |
restore_faces |
false |
Boolean |
Whether to restore faces in the image |
tiling |
false |
Boolean |
Whether tiling is enabled |
do_not_save_samples |
false |
Boolean |
Flag to prevent saving of samples |
do_not_save_grid |
false |
Boolean |
Flag to prevent saving of grid |
negative_prompt |
"string" |
String |
Negative text prompt for the model |
eta |
0 |
Integer |
Learning rate parameter |
s_min_uncond |
0 |
Integer |
Minimum unconditional step size |
s_churn |
0 |
Integer |
Churn rate |
s_tmax |
0 |
Integer |
Maximum temperature |
s_tmin |
0 |
Integer |
Minimum temperature |
s_noise |
1 |
Integer |
Noise level |
override_settings |
{} |
JSON Object |
Settings to override |
override_settings_restore_afterwards |
true |
Boolean |
Whether to restore settings afterwards |
script_args |
[] |
Array |
Additional script arguments |
sampler_index |
"Euler" |
String |
Index of the sampler |
include_init_images |
false |
Boolean |
Whether to include initial images |
Parameter Explanation
The denoising_strength parameter is used in the img2img/inpaint module.
It is a float that represents the strength of denoising applied to an image. According to a discussion on GitHub, the following values are recommended for the denoising_strength parameter2:
•If you are confident about the model you are using and want fewer modifications on the image, lower your denoising_strength to ~0.4. Switch your hires. fix upscaler to non-Latent upscalers (e.g. LANCZOS, ESRGAN). You will get some nice images.
•If you want more modifications and more potential, apply a higher denoising_strength (~0.55 to ~0.7). Pick a favorite Latent upscaler. You will get just what you want.
•For a general solution, don’t use hires. fix. Use extra->upscale to upscale your image (make your image sharper if possible), send the upscaled image to img2img. If you want more potential, using Inpaint and Inpaint Sketch is better. Process and finetune. You will get some awesome images (just wasting too much time compared with other alternative solutions).
The image_cfg_scale parameter is used in the img2img/inpaint module.
It is a float that represents the scale of the image configuration.
According to a discussion on GitHub, the image_cfg_scale parameter is added as an option to the XYZ Plot script on the img2img tab when an InstructPix2Pix model is loaded.
However, there is another discussion on GitHub where a user reported that the image_cfg_scale slider for InstructPix2Pix models provided in the img2img tab seems to not do anything.
The mask parameter is used in the img2img/inpaint module.
It is a binary image that represents the region of the image to be inpainted.
Example
'***********************************
' IRS.-Sample
'***********************************
Remarks
-
Limitations:
-
See also:
• ! Smart Package Robot 's Parallel Robot Operations