AI Stylist Assistant in Mobile Applications
An AI stylist in mobile apps handles two tasks: analyzing personal wardrobe (what do I own, what matches) and recommending new items by preference. Both require image work—this distinguishes the stylist from most other AI assistants where text suffices.
Wardrobe Inventory: Vision API for Clothing
Users photograph clothes, and the assistant recognizes:
- Item type (shirt, jeans, dress, coat...)
- Color and pattern
- Style (casual, formal, sport, vintage...)
- Seasonality
GPT-4o Vision handles this out of the box—no separate model needed:
// iOS: clothing image analysis via GPT-4o Vision
func analyzeClothingItem(_ image: UIImage) async throws -> ClothingItem {
guard let imageData = image.jpegData(compressionQuality: 0.7) else {
throw AnalysisError.invalidImage
}
let base64Image = imageData.base64EncodedString()
let messages: [[String: Any]] = [{
"role": "user",
"content": [
["type": "image_url", "image_url": ["url": "data:image/jpeg;base64,\(base64Image)"]],
["type": "text", "text": """
Analyze this clothing item. Return JSON:
{
"type": "shirt|pants|dress|jacket|shoes|...",
"colors": ["primary color", "secondary color if exists"],
"pattern": "solid|striped|checkered|floral|...",
"style": ["casual", "formal", "sport", ...],
"season": ["spring", "summer", "autumn", "winter"],
"material_guess": "cotton|denim|leather|..."
}
"""]
]
}]
let response = try await openAIClient.chat(messages: messages, responseFormat: .jsonObject)
return try JSONDecoder().decode(ClothingItem.self, from: response.data(using: .utf8)!)
}
For wardrobe storage use Core Data / Room with thumbnail images and JSON attributes. Full-size photos in local storage, reference in database.
Outfit Suggestions from Existing Wardrobe
Once the wardrobe is populated, the main function—"what should I wear today?" Request includes weather, occasion, preferences.
func suggestOutfit(
wardrobe: [ClothingItem],
occasion: String, // "work", "casual friday", "date", "sport"
weather: WeatherContext,
avoidItems: [String] // already worn today/yesterday
) async throws -> OutfitSuggestion {
let wardrobeDescription = wardrobe.map {
"ID:\($0.id) - \($0.type), colors: \($0.colors.joined(separator: "/")), style: \($0.style.joined(separator: ","))"
}.joined(separator: "\n")
let prompt = """
Select a complete outfit from the wardrobe below.
Occasion: \(occasion)
Weather: \(weather.temperature)°C, \(weather.condition)
Avoid (recently worn): \(avoidItems.joined(separator: ", "))
Wardrobe:
\(wardrobeDescription)
Return JSON: {items: [id], reasoning: "brief style logic", alternatives: [[id]]}
"""
// ...
}
reasoning is a text explanation. Users value understanding why this combination works: "navy shirt + light chinos creates dark/light contrast suitable for casual office."
Color Compatibility
LLMs understand color pairing rules, but sometimes hallucinate. Add a deterministic filter based on color theory: complementary, analogous, triadic colors via HSL space.
// Android - basic color compatibility
fun areColorsCompatible(color1: HslColor, color2: HslColor): Boolean {
val hueDiff = abs(color1.hue - color2.hue)
val normalizedDiff = minOf(hueDiff, 360 - hueDiff)
return when {
normalizedDiff < 30 -> true // analogous
normalizedDiff in 150f..210f -> true // complementary
normalizedDiff in 110f..130f -> true // triadic
color1.saturation < 0.15f -> true // neutral with any
color2.saturation < 0.15f -> true // neutral with any
else -> false
}
}
Apply this filter before LLM requests: if the model suggests an incompatible pair, return alternatives.
AR Try-On
Try-on is high priority for fashion apps. Implementation options:
Overlay on photo: user uploads photo, clothing overlays on top. On iOS use CoreML with body segmentation (DeepLab v3+), then CoreImage compositing. Quality is moderate.
Virtual try-on service: Kiri Engine, Fashn AI, Replicate's IDM-VTON—cloud APIs. Significantly better quality, but 5–15 seconds per generation. For mobile: asynchronous request with push notification on completion.
func startTryOn(userPhoto: UIImage, clothingImage: UIImage) async throws -> String {
// Returns jobId, result comes via webhook/polling
let jobId = try await tryOnAPI.submitJob(person: userPhoto, garment: clothingImage)
return jobId
}
func pollTryOnResult(jobId: String) async throws -> UIImage {
for _ in 0..<30 { // max 30 attempts x 2 sec = 60 sec
try await Task.sleep(nanoseconds: 2_000_000_000)
let status = try await tryOnAPI.checkStatus(jobId: jobId)
if status.isReady, let url = status.resultUrl {
return try await loadImage(from: url)
}
}
throw TryOnError.timeout
}
Timeline Estimates
Basic assistant with text recommendations—3–5 days. Full wardrobe with Vision photo analysis + outfit suggestions + color compatibility—3–4 weeks. AR try-on via cloud API—plus 1–2 weeks.







