sace changes
This commit is contained in:
@ -16,22 +16,28 @@ const KEYWORDS = [
|
||||
'ball gown dress',
|
||||
'cosplay outfit',
|
||||
'vintage skirt outfit',
|
||||
'casual skirt outfit'];
|
||||
'casual skirt outfit',
|
||||
'harajuku outfit',
|
||||
'pop colorful outfit',
|
||||
'cute colorful outfit',
|
||||
'japanese idol outfit',
|
||||
'folk dress outfit',
|
||||
];
|
||||
const TARGET_COUNT = Number(process.env.IMAGE_COUNT || 20);
|
||||
const PROMPT =
|
||||
`Change pose of the person in the image1 to stantind in front of camera, with a smile, full body visible, wearing a fashionable outfit suitable for a casual day out. The background should be a white. Ensure the lighting is bright and natural, highlighting the details of the outfit and the person's features.
|
||||
`;
|
||||
|
||||
const PROMPT2 =
|
||||
`Extract clothes from image1, put it on the white backgroud
|
||||
`Extract clothes from image1, put it on the light gray backgroud
|
||||
`;
|
||||
|
||||
type ServerCfg = { baseUrl: string; outputDir: string; inputDir: string };
|
||||
|
||||
function getServerConfig(): ServerCfg {
|
||||
const candidates = [
|
||||
{ baseUrl: process.env.SERVER1_COMFY_BASE_URL, outputDir: process.env.SERVER1_COMFY_OUTPUT_DIR },
|
||||
//{ baseUrl: process.env.SERVER2_COMFY_BASE_URL, outputDir: process.env.SERVER2_COMFY_OUTPUT_DIR },
|
||||
//{ baseUrl: process.env.SERVER1_COMFY_BASE_URL, outputDir: process.env.SERVER1_COMFY_OUTPUT_DIR },
|
||||
{ baseUrl: process.env.SERVER2_COMFY_BASE_URL, outputDir: process.env.SERVER2_COMFY_OUTPUT_DIR },
|
||||
].filter((s): s is { baseUrl: string; outputDir: string } => !!s.baseUrl && !!s.outputDir);
|
||||
|
||||
if (candidates.length === 0) {
|
||||
@ -101,26 +107,26 @@ async function processImages(imagePaths: string[], server: ServerCfg) {
|
||||
logger.info(`Copied ${localImagePath} -> ${serverInputPath}`);
|
||||
|
||||
// Run conversion (sequential to avoid output race conditions)
|
||||
const generatedPath1 = await convertImage(
|
||||
PROMPT,
|
||||
const generatedPath1 = await extractCloth(
|
||||
PROMPT2,
|
||||
baseName,
|
||||
server.baseUrl,
|
||||
server.outputDir,
|
||||
{ width: 720, height: 1280 } // portrait
|
||||
);
|
||||
/*
|
||||
await fs.copyFile(generatedPath1, serverInputPath);
|
||||
const baseName2 = path.basename(localImagePath);
|
||||
|
||||
await fs.copyFile(generatedPath1, serverInputPath);
|
||||
const baseName2 = path.basename(localImagePath);
|
||||
|
||||
const generatedPath2 = await extractCloth(
|
||||
PROMPT2,
|
||||
baseName2,
|
||||
server.baseUrl,
|
||||
server.outputDir,
|
||||
{ width: 720, height: 1280 } // portrait
|
||||
);
|
||||
|
||||
logger.info(`Generated image: ${generatedPath2}`);
|
||||
const generatedPath2 = await extractCloth(
|
||||
PROMPT2,
|
||||
baseName2,
|
||||
server.baseUrl,
|
||||
server.outputDir,
|
||||
{ width: 720, height: 1280 } // portrait
|
||||
);
|
||||
*/
|
||||
logger.info(`Generated image: ${generatedPath1}`);
|
||||
} catch (err) {
|
||||
logger.error(`Failed to convert ${localImagePath}:`, err);
|
||||
} finally {
|
||||
|
||||
@ -8,33 +8,21 @@ import { convertImage } from '../lib/image-converter';
|
||||
dotenv.config();
|
||||
|
||||
const KEYWORDS = [
|
||||
'teen girl portrait',
|
||||
'woman portrait',
|
||||
'woman face close',
|
||||
'teen face close',
|
||||
'beautiful woman face closeup',
|
||||
'beautiful teen',
|
||||
'russian teen',
|
||||
'skandinavian teen',
|
||||
'uk teen',
|
||||
'asian teen',
|
||||
'east european teen',
|
||||
'cute teen',
|
||||
'beautiful woman',
|
||||
'russian woman',
|
||||
'skandinavian woman',
|
||||
'uk woman',
|
||||
'asian woman',
|
||||
'east european woman',
|
||||
'cute woman',];
|
||||
'fullbody pose cute ',
|
||||
'fullbody pose model ',
|
||||
'fullbody pose woman ',
|
||||
'fullbody pose idol ',
|
||||
'fullbody pose kawaii',
|
||||
'fullbody pose japanese',
|
||||
'fullbody pose kawaii sit',
|
||||
'fullbody pose model sit',
|
||||
'fullbody pose cute sit',];
|
||||
const TARGET_COUNT = Number(process.env.IMAGE_COUNT || 20);
|
||||
const PROMPT =
|
||||
`change camera angle to closeup face from image1,
|
||||
change background to light gray with faing gradient,
|
||||
change face angle to look at directry look at camera˛
|
||||
change lighting to soft light,
|
||||
change face expression to neautral expression,
|
||||
change age to 20 years old,
|
||||
`
|
||||
change camera angle to fullbody shot from image1,
|
||||
change background to light gray with faing gradient,
|
||||
change clothes to shite sports bra and shite cotton short pants
|
||||
`;
|
||||
|
||||
type ServerCfg = { baseUrl: string; outputDir: string; inputDir: string };
|
||||
Reference in New Issue
Block a user