Cap Comfly GPT image size to stable edit resolution
This commit is contained in:
parent
a939e000cf
commit
a420e4cf33
@ -31,6 +31,7 @@ const DEFAULT_TIMEOUT_MS = 300000;
|
|||||||
const LONG_RUNNING_COMFLY_TIMEOUT_MS = 590000;
|
const LONG_RUNNING_COMFLY_TIMEOUT_MS = 590000;
|
||||||
const OPENAI_IMAGE_MIN_TOTAL_PIXELS = 3_686_400;
|
const OPENAI_IMAGE_MIN_TOTAL_PIXELS = 3_686_400;
|
||||||
const OPENAI_IMAGE_DIMENSION_MULTIPLE = 16;
|
const OPENAI_IMAGE_DIMENSION_MULTIPLE = 16;
|
||||||
|
const COMFLY_GPT_IMAGE_STABLE_EDIT_EDGE = 1536;
|
||||||
const COMFLY_GPT_IMAGE_MAX_EDGE = 3840;
|
const COMFLY_GPT_IMAGE_MAX_EDGE = 3840;
|
||||||
const COMFLY_GPT_IMAGE_MAX_TOTAL_PIXELS = 8_294_400;
|
const COMFLY_GPT_IMAGE_MAX_TOTAL_PIXELS = 8_294_400;
|
||||||
const BLTCY_HOST_REGEX = /(^|\.)bltcy\.ai$/i;
|
const BLTCY_HOST_REGEX = /(^|\.)bltcy\.ai$/i;
|
||||||
@ -207,9 +208,9 @@ function resolveOpenAISize(aspectRatio: string, imageSize: "1K" | "2K" | "4K") {
|
|||||||
|
|
||||||
function resolveComflyGptImageSize(aspectRatio: string, imageSize: "1K" | "2K" | "4K") {
|
function resolveComflyGptImageSize(aspectRatio: string, imageSize: "1K" | "2K" | "4K") {
|
||||||
const edgeMap: Record<typeof imageSize, number> = {
|
const edgeMap: Record<typeof imageSize, number> = {
|
||||||
"1K": 1024,
|
"1K": COMFLY_GPT_IMAGE_STABLE_EDIT_EDGE,
|
||||||
"2K": 2048,
|
"2K": COMFLY_GPT_IMAGE_STABLE_EDIT_EDGE,
|
||||||
"4K": COMFLY_GPT_IMAGE_MAX_EDGE,
|
"4K": COMFLY_GPT_IMAGE_STABLE_EDIT_EDGE,
|
||||||
};
|
};
|
||||||
const { width, height } = resolveLongestEdgeDimensions({
|
const { width, height } = resolveLongestEdgeDimensions({
|
||||||
aspectRatio,
|
aspectRatio,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user