Training specialized AI models to capture character likenesses and cinematic style for groundbreaking rendering
Building upon my background in neural networks from previous USC coursework, I undertook the challenge of training custom LoRA (Low-Rank Adaptation) models as a crucial component of my innovative ExMachina project. My goal was to accurately capture the likenesses of Alicia Vikander's Ava and Oscar Isaac's Nathan, along with the distinctive cinematographic style of the film "Ex Machina." This training process represented a significant technical undertaking in early 2023, when AI model training resources were limited and best practices were still emerging.
My journey began with general AI experimentation and textual embeddings before I discovered that LoRAs offered the perfect balance of training efficiency and visual quality for character-specific needs. Through methodical development and numerous iterations, I created specialized models that could transform my Unity-based 3D renders into photorealistic scenes that precisely matched the original film's characters and visual aesthetic. This model development became the cornerstone of my comprehensive AI-powered rendering pipeline for the project.
Create custom AI models that could accurately render Ex Machina characters and style for my film recreation project
February - April 2023, during the early days of LoRA training technology
Dataset Creator, ML Engineer, and Visual Director responsible for all aspects of the training process
Stable Diffusion 1.5, Auto1111, Kohya LoRA Training, Google Colab, Dataset Creation & Captioning Tools
Creating photorealistic, character-accurate renders for my ExMachina project required models specifically trained on the film's characters and visual style, but several significant challenges stood in the way:
Through persistent experimentation and learning from the emerging AI community, I developed a comprehensive solution:
One of my first Nathan LoRA test outputs
Problematic training image: Ava with hair created dataset conflicts
My approach to LoRA training evolved significantly throughout the project as I experimented with different techniques and learned from both successes and failures.
I began by diving deep into the emerging world of AI image generation and model training. As I noted in my journal on January 3, 2023: "spent most of the day learning to use/install stable diffusion" and January 5: "dedicated two straight days to learning stable diffusion and I'm still not done."
This learning phase included:
One of my first ever AI image generations using InvokeAI
My initial attempts at training focused on textual embeddings, which were easier to create but produced limited results. As I documented in my journal on March 4, 2023: "continued trying to train my embedding. After removing images and fiddling values I finally got it to work... In conclusion: I'm not sure why she turns dark-skinned sometimes. I think it's the AI confusing the skin tone when she was under shadows in the training set..."
The dataset creation process involved:
Early embedding test result with my original character (used as practice)
After concluding that embeddings weren't suitable for my needs, I pivoted to an entirely different approach. I discovered LoRA training through a detailed Reddit guide by user "plum" that marked a complete change in my methodology. This new phase required different tools, techniques, and understanding compared to my previous embedding experiments.
My journal on March 12, 2023, captures this transition: "managed to install a tool on my PC to train a LORA. It took way too long to install the fukin thing. Very complicated. Then I gathered the dataset. Now I have to crop it and label it."
And on March 14: "The overnight training worked and I had a Nathan Lora. The results were quite good, but a bit distorted... I later found out I forgot to download the lora extension. After downloading it results were actually very good."
Key developments during this phase:
Early Ava LoRA outputs - full figure (left) and portrait (right) showing consistent character likeness
Through my extensive experimentation, I discovered that the captioning strategy was as important as the dataset quality itself. I developed a novel approach to captioning that focused on what didn't belong to the concept rather than what did.
This phase involved:
Caption: "Ava with hair behind a glass wall with a reflection in a red room full of red light, with a hand gesture, in the style of ExMachina"
Caption: "a MachinaHall hallway with a black door with a light on it, in the style of ExMachina"
Caption: "a closeup of Ava looking near the camera, with a white background, in the style of ExMachina"
Example dataset images with their specific captions for LoRA training
The final phase involved integrating the trained LoRAs into my video rendering workflow. This required optimization and testing to ensure they worked effectively on video sequences.
As noted in my journal on March 29, 2023: "I spent the time preparing Nathan's part of my ExMachina thing" and on March 31: "I almost gave up on the experiment today. I left it processing and realized it wasn't working well. I then realized that the corridor method of leaving most of the work to a dreambooth model and doing minimal prompting might be best. I was feeling awful, I thought I had wasted all this time. But then I looked at the processed result an it looked incredible. This reignited me."
Key achievements in this phase:
Testing Nathan LoRA on video sequences - revealing issues with profile views that needed addressing
After months of experimentation and dozens of training iterations, I successfully created LoRA models that could accurately capture the likenesses of Ava and Nathan while preserving the distinctive visual style of Ex Machina. These models became the foundation of my AI-powered rendering workflow.
Beyond the technical metrics, this project resulted in several groundbreaking outcomes:
"I think in the end I made somewhere around 45 variations of the lora... I decided to make a general lora for bodies style and environment. I decided on training all those concepts into a single lora for practicality. including several keywords into a single lora was a challenge but it was necessary so that all concepts had equal weight."
— From my project notes, March 2023
My approach to dataset creation evolved significantly through experimentation:
Caption: "Ava in front of a grey background looking at a white shirt in the lower left of the frame"
Caption: "MachinaNathan standing in a MachinaHall hallway with glasses making a hand gesture with a wall in the background"
My LoRA training process went through several stages of development:
Several technical hurdles required creative solutions:
Another early Ava test showing improving quality in facial details
This project expanded my technical understanding of AI training and opened new creative possibilities, while also revealing important lessons about the field.
This project taught me that in AI training, quality far outweighs quantity. A small, carefully curated dataset with strategic captioning produced dramatically better results than larger but less refined collections. The discovery of emergent capabilities - like the AI understanding the physical properties of Ava's transparent components without explicit training - revealed the potential for AI to internalize complex visual information from limited examples. This experience fundamentally changed my approach to AI, emphasizing careful preparation and strategic training over brute-force methods.