t1
This commit is contained in:
parent
02bf934556
commit
4fe3520cca
@ -505,4 +505,124 @@ export function image4Options_0302(
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function image4Options_0337(
|
||||
model,
|
||||
componentId,
|
||||
prompt,
|
||||
sampleStrength,
|
||||
height,
|
||||
width,
|
||||
negativePrompt = '',
|
||||
resolutionType = "2k",
|
||||
generateCount = 4
|
||||
){
|
||||
const min_version = "3.0.2"
|
||||
const version = "3.3.7"
|
||||
const submit_id = util.uuid()
|
||||
return {
|
||||
params: {
|
||||
babi_param: encodeURIComponent(
|
||||
JSON.stringify({
|
||||
scenario: "image_video_generation",
|
||||
feature_key: "aigc_to_image",
|
||||
feature_entrance: "to_image",
|
||||
feature_entrance_detail: "to_image-" + model,
|
||||
})
|
||||
),
|
||||
},
|
||||
data: {
|
||||
extend: {
|
||||
root_model: model,
|
||||
},
|
||||
submit_id: submit_id,
|
||||
metrics_extra: JSON.stringify({
|
||||
promptSource: "custom",
|
||||
generateCount: generateCount,
|
||||
enterFrom: "click",
|
||||
sceneOptions:JSON.stringify([
|
||||
{
|
||||
"type": "image",
|
||||
"scene": "ImageBasicGenerate",
|
||||
"modelReqKey": model,
|
||||
"resolutionType": resolutionType,
|
||||
"abilityList": [],
|
||||
"benefitCount": 4,
|
||||
"reportParams": {
|
||||
"enterSource": "generate",
|
||||
"vipSource": "generate",
|
||||
"extraVipFunctionKey": model+"-"+resolutionType,
|
||||
"useVipFunctionDetailsReporterHoc": true
|
||||
}
|
||||
}
|
||||
]),
|
||||
isBoxSelect: false,
|
||||
isCutout: false,
|
||||
generateId: submit_id,
|
||||
isRegenerate: false
|
||||
}),
|
||||
draft_content: JSON.stringify({
|
||||
type: "draft",
|
||||
id: util.uuid(),
|
||||
min_version: min_version,
|
||||
is_from_tsn: true,
|
||||
version: version,
|
||||
main_component_id: componentId,
|
||||
component_list: [
|
||||
{
|
||||
type: "image_base_component",
|
||||
id: componentId,
|
||||
min_version: min_version,
|
||||
generate_type: "generate",
|
||||
aigc_mode: "workbench",
|
||||
metadata: {
|
||||
"type": "",
|
||||
"id": util.uuid(),
|
||||
"created_platform": 3,
|
||||
"created_platform_version": "",
|
||||
"created_time_in_ms": Math.floor(Date.now()/1000),
|
||||
"created_did": ""
|
||||
},
|
||||
abilities: {
|
||||
type: "",
|
||||
id: util.uuid(),
|
||||
generate: {
|
||||
type: "",
|
||||
id: util.uuid(),
|
||||
core_param: {
|
||||
type: "",
|
||||
id: util.uuid(),
|
||||
model,
|
||||
prompt,
|
||||
negative_prompt: negativePrompt,
|
||||
seed: Math.floor(Math.random() * 100000000) + 2500000000,
|
||||
sample_strength: sampleStrength,
|
||||
image_ratio: 5,
|
||||
large_image_info: {
|
||||
type: "",
|
||||
id: util.uuid(),
|
||||
height,
|
||||
width,
|
||||
resolution_type: resolutionType,
|
||||
},
|
||||
intelligent_ratio: false
|
||||
},
|
||||
},
|
||||
gen_option: {
|
||||
"type": "",
|
||||
"id": util.uuid(),
|
||||
"gen_count": generateCount,
|
||||
"generate_all": false
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
http_common_info: {
|
||||
aid: Number(DEFAULT_ASSISTANT_ID),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,7 @@ import logger from '@/lib/logger.js';
|
||||
import TOSService from '@/lib/tos/tos-service.js';
|
||||
import { generateImages as originalGenerateImages } from '@/api/controllers/images.js';
|
||||
import { generateVideo as originalGenerateVideo } from '@/api/controllers/video.js';
|
||||
import { request, image4Options_0302, image3Options } from '@/api/controllers/core.js';
|
||||
import { request, image4Options_0302, image4Options_0337, image3Options } from '@/api/controllers/core.js';
|
||||
import EX from "@/api/consts/exceptions.ts";
|
||||
|
||||
const timeZone = 'Asia/Shanghai';
|
||||
@ -802,7 +802,7 @@ export class TaskPollingService {
|
||||
generate_count,
|
||||
);
|
||||
if(isModel4){
|
||||
options = image4Options_0302(
|
||||
options = image4Options_0337(
|
||||
mappedModel,
|
||||
componentId,
|
||||
prompt,
|
||||
@ -813,6 +813,17 @@ export class TaskPollingService {
|
||||
'2k',
|
||||
generate_count,
|
||||
);
|
||||
// options = image4Options_0302(
|
||||
// mappedModel,
|
||||
// componentId,
|
||||
// prompt,
|
||||
// sample_strength,
|
||||
// height,
|
||||
// width,
|
||||
// negative_prompt,
|
||||
// '2k',
|
||||
// generate_count,
|
||||
// );
|
||||
}
|
||||
taskLog(`生成图片 发起请求 isModel4 ${isModel4}`);
|
||||
const res = await request(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user