save changes
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user