save changes

This commit is contained in:
2025-10-01 07:53:50 +02:00
parent 4bce4388f9
commit bdca42e821
18 changed files with 3803 additions and 4377 deletions

View File

@ -1,17 +1,17 @@
import * as fs from 'fs';
import * as path from 'path';
import { convertImageVton } from '../lib/image-converter';
import { convertImageVton, convertImage } from '../lib/image-converter';
import * as dotenv from 'dotenv';
dotenv.config();
const clothesDir = 'C:\\Users\\ken\\Desktop\\VTON\\clothes';
const modelPath = 'C:\\Users\\ken\\Desktop\\VTON\\models\\Jessica_body.png';
const posesDir = 'C:\\Users\\ken\\Desktop\\VTON\\poses';
const clothesDir = 'C:\\Users\\fm201\\Documents\\VTON\\\clothes';
const modelPath = 'C:\\Users\\fm201\\Documents\\VTON\\models\\Jessica_body.png';
const posesDir = 'C:\\Users\\fm201\\Documents\\VTON\\\poses';
const outputDir = 'generated';
const comfyBaseUrl = process.env.SERVER1_COMFY_BASE_URL;
const comfyOutputDir = process.env.SERVER1_COMFY_OUTPUT_DIR;
const comfyBaseUrl = process.env.SERVER2_COMFY_BASE_URL;
const comfyOutputDir = process.env.SERVER2_COMFY_OUTPUT_DIR;
async function generateVtonImages() {
if (!comfyBaseUrl || !comfyOutputDir) {
@ -34,10 +34,13 @@ async function generateVtonImages() {
console.log(`Processing cloth: ${clothFile} with pose: ${randomPoseFile}`);
const files = [modelPath, clothPath, posePath];
const convertedCloth = await convertImage("Change background to gray of image1", clothPath, comfyBaseUrl, comfyOutputDir, { width: 720, height: 1280 });
const files = [modelPath, convertedCloth, posePath];
const prompt = "change clothes of image1 with image2";
const outputFilename = `model_${i}.png`;
const generatedImagePath = await convertImageVton(files, outputFilename, comfyBaseUrl, comfyOutputDir, { width: 720, height: 1280 });
if (generatedImagePath) {