Spaces:
Running
Running
time to push to HF
Browse files- app/api/process/route.ts +1 -5
app/api/process/route.ts
CHANGED
|
@@ -59,7 +59,6 @@ function parseDataUrl(dataUrl: string): { mimeType: string; data: string } | nul
|
|
| 59 |
export async function POST(req: NextRequest) {
|
| 60 |
try {
|
| 61 |
// Log incoming request size for debugging and monitoring
|
| 62 |
-
const contentLength = req.headers.get('content-length');
|
| 63 |
|
| 64 |
// Parse and validate the JSON request body
|
| 65 |
let body: any;
|
|
@@ -267,7 +266,6 @@ The result should look like all subjects were photographed together in the same
|
|
| 267 |
|
| 268 |
// We'll collect additional inline image parts (references)
|
| 269 |
const referenceParts: { inlineData: { mimeType: string; data: string } }[] = [];
|
| 270 |
-
let imageCounter = 2; // Start at 2 since image 1 is the primary input
|
| 271 |
|
| 272 |
// Background modifications
|
| 273 |
if (params.backgroundType) {
|
|
@@ -414,7 +412,7 @@ The result should look like all subjects were photographed together in the same
|
|
| 414 |
lightingDescription = "professional studio lighting";
|
| 415 |
}
|
| 416 |
|
| 417 |
-
|
| 418 |
|
| 419 |
prompts.push(`Crop the head and create a 2-inch ID photo. Place the person in a professional photo studio with ${setupDescription} and ${lightingDescription}. Create a clean, professional portrait setup with proper studio atmosphere.${positioningInstruction}`);
|
| 420 |
|
|
@@ -486,8 +484,6 @@ The result should look like all subjects were photographed together in the same
|
|
| 486 |
// Camera settings - Enhanced for Gemini 2.5 Flash Image
|
| 487 |
if (params.focalLength || params.aperture || params.shutterSpeed || params.whiteBalance || params.angle ||
|
| 488 |
params.iso || params.filmStyle || params.lighting || params.bokeh || params.composition || params.motionBlur) {
|
| 489 |
-
const cameraSettings: string[] = [];
|
| 490 |
-
|
| 491 |
// Build cinematic camera prompt for professional, movie-like results
|
| 492 |
let cameraPrompt = "CINEMATIC CAMERA TRANSFORMATION: Transform this image into a professional, cinematic photograph with movie-quality production values";
|
| 493 |
|
|
|
|
| 59 |
export async function POST(req: NextRequest) {
|
| 60 |
try {
|
| 61 |
// Log incoming request size for debugging and monitoring
|
|
|
|
| 62 |
|
| 63 |
// Parse and validate the JSON request body
|
| 64 |
let body: any;
|
|
|
|
| 266 |
|
| 267 |
// We'll collect additional inline image parts (references)
|
| 268 |
const referenceParts: { inlineData: { mimeType: string; data: string } }[] = [];
|
|
|
|
| 269 |
|
| 270 |
// Background modifications
|
| 271 |
if (params.backgroundType) {
|
|
|
|
| 412 |
lightingDescription = "professional studio lighting";
|
| 413 |
}
|
| 414 |
|
| 415 |
+
const positioningInstruction = faceCamera ? " Position the person to face directly toward the camera with confident posture." : "";
|
| 416 |
|
| 417 |
prompts.push(`Crop the head and create a 2-inch ID photo. Place the person in a professional photo studio with ${setupDescription} and ${lightingDescription}. Create a clean, professional portrait setup with proper studio atmosphere.${positioningInstruction}`);
|
| 418 |
|
|
|
|
| 484 |
// Camera settings - Enhanced for Gemini 2.5 Flash Image
|
| 485 |
if (params.focalLength || params.aperture || params.shutterSpeed || params.whiteBalance || params.angle ||
|
| 486 |
params.iso || params.filmStyle || params.lighting || params.bokeh || params.composition || params.motionBlur) {
|
|
|
|
|
|
|
| 487 |
// Build cinematic camera prompt for professional, movie-like results
|
| 488 |
let cameraPrompt = "CINEMATIC CAMERA TRANSFORMATION: Transform this image into a professional, cinematic photograph with movie-quality production values";
|
| 489 |
|