Week 02 – Biometric Generation & Facial Editing
Dates: 2025-06-01 – 2025-06-07
Internship: AI/ML Intern at SynerSense Pvt. Ltd.
Mentor: Praveen Kulkarni Sir
Focus
This week involved exploring ComfyUI and other tools to synthetically generate facial biometric data, modify features using inpainting, and experiment with scar overlays.
Goals for the Week
- Generate fake biometric images using ComfyUI
- Add synthetic features (black line, scar) to facial images
- Explore alternative generation tools: InvokeAI, Automatic1111, Replicate
- Create human-like facial outputs with node workflows and prompt tuning
Tasks Completed
| Task | Status | Notes |
|---|---|---|
| Generated biometric-style face (no specs, neutral pose) using ComfyUI | ✅ Completed | Used prompts with facial constraints |
| Added black line to face image programmatically | ✅ Completed | Used Python & OpenCV |
| Designed prompt to replace black line with a scar | ✅ Completed | Implemented via Stable Diffusion inpainting |
| Explored and compared generation tools (ComfyUI, InvokeAI, etc.) | ✅ Completed | Identified potential of each tool for future workflows |
| Built workflow to enhance facial details using nodes in ComfyUI | ✅ Completed | Achieved realistic results through graph-based pipeline |
Day 5: 13 February 2026
Work Description
Today’s work focused on improving visual prioritization, interaction clarity, and frontend state stability within the relabeling module.
Error-Based Visual Prioritization System: I implemented a dynamic error computation system to help users quickly identify high-priority correction points. The frontend now calculates the error value as the absolute difference between actual and predicted values. For each visible point, the system derives minimum and maximum error values and normalizes them on a 0–1 scale.
Based on this normalized value, a color interpolation mechanism was introduced:
- Low error → Green
- High error → Red
- Mid-range → Gradient shades between green and red
The computation is handled using memoization to prevent unnecessary recalculations and ensure drag performance remains smooth. Error is treated strictly as derived state and is not stored in the persistent relabel JSON file, maintaining architectural cleanliness.
Modified Point Indicator Enhancement: To improve clarity during relabeling, I introduced an isModified flag within the canonical point state. When a point is dragged, this flag is set to true. Rendering logic was updated so that:
- Default points are displayed as circles
- Modified points are displayed using an “X” marker
This provides immediate visual feedback and helps users track corrections during bulk editing.
Stability and Performance Validation:
- Verified that error values recalculate correctly after drag operations
- Confirmed consistent behavior with Undo actions
- Ensured no performance degradation from gradient-based rendering
- Maintained clear separation between canonical relabel state, derived graph metrics, interaction state, and UI state
Key Outcomes
- Introduced intelligent color-based prioritization for faster corrections
- Added clear visual indicators for modified points
- Preserved clean state architecture without polluting persistent data
- Ensured performance stability with memoization
Learning Outcome
Today enhanced my understanding of derived state management, frontend data normalization, visual encoding for usability, and performance optimization using memoization techniques. I also strengthened architectural discipline by maintaining strict separation between persistent state and computed UI metrics.
Key Learnings
- ComfyUI workflows can be fine-tuned for biometric and facial realism
- Stable Diffusion inpainting + ControlNet enables creative control
- Multiple tools offer trade-offs: use what fits the goal & complexity
- Consistency in output quality can be handled by systemized pipelines
Problems Faced & Solutions
| Problem | Solution |
|---|---|
| Lack of realism in generated faces | Switched models, explored more humanistic face generation |
| Workflow getting too reliant on one tool | Expanded exploration to InvokeAI, A1111, Replicate |
| Prompt not giving desired scar effect | Tweaked prompts and used ControlNet with mask editing in ComfyUI |
| Unclear consistency between runs | Discussed with mentor about future integration with AI stack team |
📎 References
Goals for Next Week
- Implement Hugging Face login flow with Gradio
- Show user identity after Google login
- Fix environment issues in Spaces (Python version, OAuth vars)
Screenshots (Optional)
Add before/after images, mask editor view, scar rendering outputs
“This week taught me that tool flexibility matters as much as skill depth—great workflows come from trying, tweaking, and switching when needed.”