58 lines
2.0 KiB
Markdown
58 lines
2.0 KiB
Markdown
# How to install
|
|
Drop the .py files in your automatic1111 scripts folder.
|
|
|
|
# CFG-Schedule-for-Automatic1111-SD
|
|
Note: Works with Eular a. Might not work with the rest of the samplers.
|
|
|
|
|
|
## CFG Auto.py
|
|
A simplified version. Contains tools to make the small denoising effective.
|
|
Its main use is to fix img2img drastic change to images and makes it preserve original image features.
|
|
|
|
Following was set on denising: 0.1
|
|
Batch size is used to loop. Batch size:4
|
|
##
|
|
Input: output 
|
|
|
|
|
|
## CFG Schedule.py
|
|
A script for scheduling CFG scale and ETA to change during the denoising steps
|
|
<pre>
|
|
Modified code of https://github.com/tkalayci71/attenuate-cfg-scale
|
|
To use: Place the .py file in AUTOMATIC1111\scripts folder
|
|
Update: 11/14/2022
|
|
-Now works with all samplers
|
|
-new function x. Example use: x(t,60,70,2) which will map t to be 0 at 60 and 1 and 70, then multipy by 2
|
|
-edit: Indecies can now have more than one index. Example: 0,5:=1 ; 1:10
|
|
Update: 11/13/2022
|
|
|
|
You can now use functions like:
|
|
0:=math.sin(t) , 10:=math.cos(t)
|
|
or simply just:
|
|
=math.sin(t)
|
|
|
|
Available variables:
|
|
t: current step
|
|
T: total steps
|
|
e: (1-t/T) which is current ETA
|
|
d: denoising strength
|
|
pi:pi
|
|
cfg: initial CFG
|
|
math: The python math module
|
|
|
|
Available functions:
|
|
-From python: min, max, pow, abs
|
|
-x(value,min,max,multiply)
|
|
This will take value and make it 0 when <=min, and make it 1 when >=max. Then, multiply result by last argumant.
|
|
If multiply is less than 0, the range becomes 1 to 0 instead
|
|
|
|
|
|
|
|
I've tried the following function on 58 steps and it is giving good results:
|
|
CFG:
|
|
0:=math.fabs( (e*1.4-2)*15);30:5
|
|
ETA:
|
|
0:=0.01; 20:=e*1.5;10:=e
|
|
</pre>
|
|

|