178 lines
5.0 KiB
JavaScript
178 lines
5.0 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: fd0220e4d10052af.701bdafa2d.js
|
|
* Module id: 877497
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
var t = e.i(197895);
|
|
function n(e) {
|
|
return "STANDARD" === e ? "nebula-core" : "nebula-ultra";
|
|
}
|
|
function i(e, t) {
|
|
return "STANDARD" === t ? "auto" : (e?.toUpperCase() ?? "2K");
|
|
}
|
|
function r(e, r) {
|
|
let { model: a, quality: o, ...s } = e,
|
|
c = { ...s, quality: i(o, a), modeType: "image2image" };
|
|
return (
|
|
void 0 !== e.ratio && (c.ratio = e.ratio),
|
|
void 0 !== e.width && (c.width = e.width),
|
|
void 0 !== e.height && (c.height = e.height),
|
|
{
|
|
params: c,
|
|
metadata: { node_id: r.nodeId, project_id: r.projectId },
|
|
provider: "nebula",
|
|
model: n(a),
|
|
taskType: "image",
|
|
requestId: (0, t.v4)(),
|
|
}
|
|
);
|
|
}
|
|
function a(e, r) {
|
|
let a = {
|
|
originImage: e.originImage,
|
|
n: e.n,
|
|
quality: i(e.quality, e.model),
|
|
scene: e.scene,
|
|
modeType: "image2image",
|
|
};
|
|
return (
|
|
void 0 !== e.ratio && (a.ratio = e.ratio),
|
|
void 0 !== e.width && (a.width = e.width),
|
|
void 0 !== e.height && (a.height = e.height),
|
|
{
|
|
params: a,
|
|
metadata: { node_id: r.nodeId, project_id: r.projectId },
|
|
provider: "nebula",
|
|
model: n(e.model),
|
|
taskType: "image",
|
|
requestId: (0, t.v4)(),
|
|
}
|
|
);
|
|
}
|
|
function o(e, r) {
|
|
let a = {
|
|
originImage: e.originImage,
|
|
n: e.n,
|
|
quality: i(e.quality, e.model),
|
|
scene: e.scene,
|
|
modeType: "image2image",
|
|
};
|
|
return (
|
|
void 0 !== e.aspect_ratio && (a.aspect_ratio = e.aspect_ratio),
|
|
void 0 !== e.width && (a.width = e.width),
|
|
void 0 !== e.height && (a.height = e.height),
|
|
{
|
|
params: { ...a },
|
|
metadata: { node_id: r.nodeId, project_id: r.projectId },
|
|
provider: "nebula",
|
|
model: n(e.model),
|
|
taskType: "image",
|
|
requestId: (0, t.v4)(),
|
|
}
|
|
);
|
|
}
|
|
function s(e, n) {
|
|
return {
|
|
params: {
|
|
images: e.images,
|
|
quality: e.quality,
|
|
scene: "upscaler",
|
|
modeType: "image2image",
|
|
},
|
|
metadata: { node_id: n.nodeId, project_id: n.projectId },
|
|
provider: "upscaler",
|
|
model: e.model || "image-upscaler",
|
|
taskType: "image",
|
|
requestId: (0, t.v4)(),
|
|
};
|
|
}
|
|
function c(e, n) {
|
|
return {
|
|
params: {
|
|
prompt: e.prompt,
|
|
images: e.images,
|
|
horizontal_angle: e.horizontal_angle,
|
|
vertical_angle: e.vertical_angle,
|
|
zoom: e.zoom,
|
|
modeType: "image2image",
|
|
},
|
|
metadata: { node_id: n.nodeId, project_id: n.projectId },
|
|
provider: "comfyai",
|
|
model: "multiple-angles",
|
|
taskType: "image",
|
|
requestId: (0, t.v4)(),
|
|
};
|
|
}
|
|
function l(e, n) {
|
|
let i = {
|
|
originImage: e.originImage,
|
|
scene: "light-control",
|
|
modeType: "image2image",
|
|
};
|
|
return (
|
|
void 0 !== e.prompt && (i.prompt = e.prompt),
|
|
void 0 !== e.UI_KeyLight && (i.UI_KeyLight = e.UI_KeyLight),
|
|
void 0 !== e.UI_LightColor && (i.UI_LightColor = e.UI_LightColor),
|
|
void 0 !== e.UI_LightBrightness &&
|
|
(i.UI_LightBrightness = e.UI_LightBrightness),
|
|
void 0 !== e.UI_RimLight && (i.UI_RimLight = e.UI_RimLight),
|
|
void 0 !== e.Reference_Image_Intent &&
|
|
(i.Reference_Image_Intent = e.Reference_Image_Intent),
|
|
void 0 !== e.width && (i.width = e.width),
|
|
void 0 !== e.height && (i.height = e.height),
|
|
{
|
|
params: i,
|
|
metadata: { node_id: n.nodeId, project_id: n.projectId },
|
|
provider: "nebula",
|
|
model: "nebula-ultra",
|
|
taskType: "image",
|
|
requestId: (0, t.v4)(),
|
|
}
|
|
);
|
|
}
|
|
function u(e, t) {
|
|
return {
|
|
images: [
|
|
(function (e) {
|
|
try {
|
|
let t = new URL(e);
|
|
return t.pathname.startsWith("/")
|
|
? t.pathname.slice(1)
|
|
: t.pathname;
|
|
} catch {
|
|
return e;
|
|
}
|
|
})(e),
|
|
],
|
|
mode: 1,
|
|
eid: t.eid,
|
|
sourceStorage: "ALIYUN",
|
|
sourceBucket: "libtv-resource-prod",
|
|
targetStorage: "ALIYUN",
|
|
targetBucket: "libtv-resource-prod",
|
|
cid: t.cid,
|
|
};
|
|
}
|
|
e.s([
|
|
"buildRemoveBackgroundRequest",
|
|
() => u,
|
|
"handleGenerateAngle",
|
|
() => c,
|
|
"handleGenerateErase",
|
|
() => a,
|
|
"handleGenerateLighting",
|
|
() => l,
|
|
"handleGenerateOutpaint",
|
|
() => o,
|
|
"handleGenerateRepaint",
|
|
() => r,
|
|
"handleGenerateUpscale",
|
|
() => s,
|
|
]);
|
|
};
|
|
|
|
export default moduleFactory;
|