TLDR: 1.Loads photo descriptions 2.Uses Ollama to enhance the descriptions 3.Sends them to ComfyUI 4.Saves the generated images
A stunning portrait showcasing intricate tattoo details and mesmerizing blue eyes
This project uses ComfyUI to generate hyperrealistic portraits using a custom workflow with the FLUX model. The system consists of two main scripts that work together to create beautiful, AI-generated portraits:
fetch_prompt.py
- Fetches and processes portrait promptsrun-comfy.py
- Generates images using ComfyUI with enhanced prompts
- High-quality portrait generation using FLUX model
- Prompt enhancement using Ollama
- Custom workflow optimized for photorealistic results
- Batch processing capabilities
- Advanced noise seed management
Creative "bug's-eye view" demonstrating the system's capability for unique perspectives
- Python 3.8+
- ComfyUI installation
- Ollama with qwen2.5:14b model
- Required models:
- FLUX model
- FluxRaslismLora.safetensors
- Eye_Detail_Flux_Lora.safetensors
- skin texture style v5.safetensors
- Clone this repository:
git clone <repository-url>
cd ai-portrait-generator
- Install dependencies:
pip install datasets requests
- Ensure ComfyUI is properly set up with required models
Run the prompt fetcher to create the initial prompt file:
python fetch_prompt.py
This will create simple_prompts.json
with curated portrait prompts.
Start the image generation process:
python run-comfy.py
Dynamic lighting demonstration with neon accents and moody atmosphere
-
Prompt Preparation
- Fetches carefully curated prompts from a dataset
- Processes and saves them in a structured JSON format
-
Image Generation
- Loads prompts from JSON
- Enhances descriptions using Ollama
- Processes through ComfyUI workflow
- Generates high-quality portraits
-
Workflow Details
- Uses FLUX model with custom LoRA adjustments
- Implements advanced sampling techniques
- Manages batch processing and seed variation
The workflow can be customized through workflow.json
, which includes:
- Image dimensions (1344x756)
- Sampling steps (25)
- Guidance scale (5.5)
- Various LoRA weights and strengths
-
Prompt Engineering
- Include specific details about facial features
- Describe lighting conditions
- Mention camera angle and perspective
- Add emotional elements
-
Model Settings
- Adjust guidance scale for different styles
- Experiment with sampling steps
- Fine-tune LoRA strengths
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- ComfyUI team
- FLUX model creators
- Dataset contributors