Add nai cfg_rescale, noise_schedule options settings

This commit is contained in:
niceandneat
2025-04-28 01:19:47 +09:00
parent 39048dd142
commit a899a02d30
3 changed files with 19 additions and 2 deletions

View File

@@ -26,8 +26,10 @@
width: 512, width: 512,
height: 512, height: 512,
sampler: 'k_euler', sampler: 'k_euler',
noise_schedule: 'native',
steps: 100, steps: 100,
scale: 1, scale: 1,
cfg_rescale: 0,
sm: false, sm: false,
sm_dyn: false, sm_dyn: false,
strength: 0.5, strength: 0.5,
@@ -245,10 +247,21 @@
</SelectInput> </SelectInput>
{/if} {/if}
<span class="text-textcolor">Noise Schedule</span>
<SelectInput className="mt-2 mb-4" bind:value={DBState.db.NAIImgConfig.noise_schedule}>
<OptionInput value="" >Choose...</OptionInput>
<OptionInput value="native" >native</OptionInput>
<OptionInput value="karras" >karras</OptionInput>
<OptionInput value="exponential" >exponential</OptionInput>
<OptionInput value="polyexponential" >polyexponential</OptionInput>
</SelectInput>
<span class="text-textcolor">steps</span> <span class="text-textcolor">steps</span>
<NumberInput size="sm" marginBottom min={0} max={2048} bind:value={DBState.db.NAIImgConfig.steps}/> <NumberInput size="sm" marginBottom min={0} max={2048} bind:value={DBState.db.NAIImgConfig.steps}/>
<span class="text-textcolor">CFG scale</span> <span class="text-textcolor">CFG scale</span>
<NumberInput size="sm" marginBottom min={0} max={2048} bind:value={DBState.db.NAIImgConfig.scale}/> <NumberInput size="sm" marginBottom min={0} max={2048} bind:value={DBState.db.NAIImgConfig.scale}/>
<span class="text-textcolor">CFG rescale</span>
<NumberInput size="sm" marginBottom min={0} max={1} bind:value={DBState.db.NAIImgConfig.cfg_rescale}/>
{#if !DBState.db.NAII2I || DBState.db.NAIImgConfig.sampler !== 'ddim_v3'} {#if !DBState.db.NAII2I || DBState.db.NAIImgConfig.sampler !== 'ddim_v3'}
<Check bind:check={DBState.db.NAIImgConfig.sm} name="Use SMEA"/> <Check bind:check={DBState.db.NAIImgConfig.sm} name="Use SMEA"/>

View File

@@ -132,7 +132,7 @@ export async function generateAIImage(genPrompt:string, currentChar:character, n
"parameters": { "parameters": {
"params_version": 3, "params_version": 3,
"add_original_image": true, "add_original_image": true,
"cfg_rescale": 0, "cfg_rescale": db.NAIImgConfig.cfg_rescale,
"controlnet_strength": 1, "controlnet_strength": 1,
"dynamic_thresholding": false, "dynamic_thresholding": false,
"n_samples": 1, "n_samples": 1,
@@ -145,7 +145,7 @@ export async function generateAIImage(genPrompt:string, currentChar:character, n
"sm": false, "sm": false,
"sm_dyn": false, "sm_dyn": false,
"noise": db.NAIImgConfig.noise, "noise": db.NAIImgConfig.noise,
"noise_schedule": "native", "noise_schedule": db.NAIImgConfig.noise_schedule,
"strength": db.NAIImgConfig.strength, "strength": db.NAIImgConfig.strength,
"ucPreset": 3, "ucPreset": 3,
"uncond_scale": 1, "uncond_scale": 1,

View File

@@ -255,8 +255,10 @@ export function setDatabase(data:Database){
width:512, width:512,
height:768, height:768,
sampler:"k_dpmpp_sde", sampler:"k_dpmpp_sde",
noise_schedule:"native",
steps:28, steps:28,
scale:5, scale:5,
cfg_rescale: 0,
sm:true, sm:true,
sm_dyn:false, sm_dyn:false,
noise:0.0, noise:0.0,
@@ -1408,8 +1410,10 @@ export interface NAIImgConfig{
width:number, width:number,
height:number, height:number,
sampler:string, sampler:string,
noise_schedule:string,
steps:number, steps:number,
scale:number, scale:number,
cfg_rescale:number,
sm:boolean, sm:boolean,
sm_dyn:boolean, sm_dyn:boolean,
noise:number, noise:number,