Add support for NAI v4 model configuration and inputs

This commit is contained in:
YH_KIM
2025-04-14 04:38:47 +09:00
parent 834e1b7a2e
commit d11bff3f80
3 changed files with 53 additions and 14 deletions

View File

@@ -155,23 +155,23 @@ export async function generateAIImage(genPrompt:string, currentChar:character, n
"reference_information_extracted": db.NAIImgConfig.InfoExtracted,
"reference_strength": db.NAIImgConfig.RefStrength,
//add v4
"autoSmea": db.NAIImgConfig.autoSmea || false,
use_coords: db.NAIImgConfig.use_coords || false,
legacy_uc: db.NAIImgConfig.legacy_uc || false,
"autoSmea": db.NAIImgConfig.autoSmea,
use_coords: db.NAIImgConfig.use_coords,
legacy_uc: db.NAIImgConfig.legacy_uc,
v4_prompt:{
caption:{
base_caption:genPrompt,
char_captions: []
},
use_coords: false,//db.NAIImgConfig.v4_prompt.use_coords || false,
use_order: true//db.NAIImgConfig.v4_prompt.use_order || true
use_coords: db.NAIImgConfig.v4_prompt.use_coords,
use_order: db.NAIImgConfig.v4_prompt.use_order
},
"v4_negative_prompt":{
caption:{
base_caption:neg,
char_captions: []
},
legacy_uc: false//db.NAIImgConfig.v4_negative_prompt.legacy_uc || false,
legacy_uc: db.NAIImgConfig.v4_negative_prompt.legacy_uc,
}
}
},
@@ -211,6 +211,7 @@ export async function generateAIImage(genPrompt:string, currentChar:character, n
if(refimgbase64 !== undefined){
reqlist.body.parameters.reference_image = refimgbase64
}
console.log({img2img:reqlist});
}else{
if (db.NAIREF) {
@@ -227,8 +228,11 @@ export async function generateAIImage(genPrompt:string, currentChar:character, n
reqlist = commonReq;
reqlist.body.action = 'generate';
reqlist.body.parameters.reference_image = base64img;
console.log({generate:reqlist});
} else {
reqlist = commonReq;
reqlist.body.action = 'generate';
console.log({nothing:reqlist});
}
}
try {

View File

@@ -286,6 +286,27 @@ export function setDatabase(data:Database){
}
}
}
//add NAI v4 (사용중인 사람용 추가 DB Init)
if(checkNullish(data.NAIImgConfig.v4_prompt)){
data.NAIImgConfig.autoSmea = false;
data.NAIImgConfig.use_coords = false;
data.NAIImgConfig.legacy_uc = false;
data.NAIImgConfig.v4_prompt = {
caption:{
base_caption:"",
char_captions:[]
},
use_coords:false,
use_order:true
};
data.NAIImgConfig.v4_negative_prompt = {
caption:{
base_caption:"",
char_captions:[]
},
legacy_uc:false,
};
}
if(checkNullish(data.customTextTheme)){
data.customTextTheme = {
FontColorStandard: "#f8f8f2",
@@ -1429,10 +1450,8 @@ interface NAIImgConfigV4CharCaption{
x: number,
y: number
}[]
}
interface ComfyConfig{
workflow:string,
posNodeID: string,