ghmk Claude commited on
Commit
fdd8b6f
·
1 Parent(s): d327dce

Improve side portrait quality by using original face reference

Browse files

Enhanced Stage 2 (side portrait generation) to preserve facial details:
- Added original face image as second reference input
- Updated prompt to instruct AI: "Use the details on the second image to fill in missing parts from the first image"
- Preserves side details (ears, hair, jawline) that may be obscured in frontal view

Changes only affect side portrait generation (Stage 2).
All other stages remain unchanged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

character_forge_image/services/character_forge_service.py CHANGED
@@ -195,12 +195,17 @@ class CharacterForgeService:
195
  if progress_callback:
196
  progress_callback(2, current_stage)
197
 
198
- # Original prompt - works for ALL backends
199
- current_prompt = f"Create a side profile view of this {gender_term}{costume_instruction} focusing on the face filling the entire available space. The {gender_term} should be shown from the side (90 degree angle) with professional studio lighting against a neutral grey background. Maintain exact facial features from the reference images."
 
200
 
201
- input_images = [front_portrait, reference_full_body]
 
 
 
202
  if initial_image_type == "Face + Body (Separate)":
203
- input_images.append(reference_face)
 
204
  elif costume_image:
205
  input_images.append(costume_image)
206
 
 
195
  if progress_callback:
196
  progress_callback(2, current_stage)
197
 
198
+ # For side portrait, add original face to preserve side details
199
+ # Prompt instructs AI to use details from original (second image) to fill in missing parts from front portrait (first image)
200
+ current_prompt = f"Create a side profile view of this {gender_term}{costume_instruction} focusing on the face filling the entire available space. The {gender_term} should be shown from the side (90 degree angle) with professional studio lighting against a neutral grey background. Maintain exact facial features from the reference images. Use the details on the second image to fill in missing parts from the first image."
201
 
202
+ # Always include front_portrait as first image, original face as second
203
+ input_images = [front_portrait, reference_face]
204
+
205
+ # Add additional references based on mode
206
  if initial_image_type == "Face + Body (Separate)":
207
+ # Already have both front_portrait and reference_face
208
+ pass
209
  elif costume_image:
210
  input_images.append(costume_image)
211