DEV Community

q2408808
q2408808

Posted on

Tandoor Recipes v2.6.0 + AI Image Generation: Auto-Create Food Photos for Every Recipe

Tandoor Recipes v2.6.0 + AI Image Generation: Auto-Create Food Photos for Every Recipe

Published: March 2026 | Self-Hosted AI Tutorial


Tandoor Recipes just dropped v2.6.0 — and if you're running a self-hosted cookbook, you know the pain: beautiful recipes with no photos. Manually finding, cropping, and uploading food photos for hundreds of recipes is a nightmare.

Here's how to fix that with AI. Using NexaAPI, you can auto-generate stunning food photography for every recipe in your Tandoor cookbook for just $0.003/image.


What's New in Tandoor Recipes v2.6.0

Tandoor Recipes v2.6.0 brings the latest improvements to the popular self-hosted recipe management app. Like previous versions, it still lacks built-in AI image generation — which means there's a perfect opportunity to extend it yourself.

The Tandoor API gives you full programmatic access to your recipe library, making automation straightforward.


The Setup: Auto-Generate Food Photos with NexaAPI

What You'll Need

  • Tandoor Recipes v2.6.0 running (Docker recommended)
  • NexaAPI key from nexa-api.com or RapidAPI
  • Python 3.8+

Install Dependencies

pip install nexaapi requests Pillow
Enter fullscreen mode Exit fullscreen mode

Python Script: Auto-Generate Recipe Images

# Install: pip install nexaapi requests
from nexaapi import NexaAPI
import requests
import json

# Configuration
NEXAAPI_KEY = 'YOUR_NEXAAPI_KEY'
TANDOOR_URL = 'http://localhost:8080'  # Your Tandoor instance
TANDOOR_TOKEN = 'YOUR_TANDOOR_API_TOKEN'

client = NexaAPI(api_key=NEXAAPI_KEY)

def get_recipes_without_images():
    """Fetch recipes from Tandoor that have no image."""
    headers = {'Authorization': f'Token {TANDOOR_TOKEN}'}
    response = requests.get(
        f'{TANDOOR_URL}/api/recipe/?page_size=50',
        headers=headers
    )
    recipes = response.json()['results']
    return [r for r in recipes if not r.get('image')]

def generate_food_photo(recipe_name: str, description: str = '') -> str:
    """Generate a food photo using NexaAPI."""
    prompt = f"Professional food photography of {recipe_name}, {description}, appetizing, restaurant quality, natural lighting, shallow depth of field"

    response = client.image.generate(
        model='flux-schnell',  # Fast, high quality
        prompt=prompt,
        width=1024,
        height=1024
    )
    return response.image_url

def update_recipe_image(recipe_id: int, image_url: str):
    """Upload generated image to Tandoor recipe."""
    headers = {'Authorization': f'Token {TANDOOR_TOKEN}'}

    # Download the generated image
    img_response = requests.get(image_url)

    # Upload to Tandoor
    files = {'image': ('recipe.jpg', img_response.content, 'image/jpeg')}
    requests.patch(
        f'{TANDOOR_URL}/api/recipe/{recipe_id}/',
        headers=headers,
        files=files
    )

# Main automation loop
recipes = get_recipes_without_images()
print(f"Found {len(recipes)} recipes without images")

for recipe in recipes[:10]:  # Process 10 at a time
    print(f"Generating image for: {recipe['name']}")

    image_url = generate_food_photo(
        recipe['name'],
        recipe.get('description', '')
    )

    update_recipe_image(recipe['id'], image_url)
    print(f"  ✅ Done — cost: $0.003")

print(f"Total cost: ${len(recipes[:10]) * 0.003:.3f}")
Enter fullscreen mode Exit fullscreen mode

JavaScript Version

// Install: npm install nexaapi node-fetch
import NexaAPI from 'nexaapi';
import fetch from 'node-fetch';

const client = new NexaAPI({ apiKey: 'YOUR_NEXAAPI_KEY' });
const TANDOOR_URL = 'http://localhost:8080';
const TANDOOR_TOKEN = 'YOUR_TANDOOR_API_TOKEN';

async function generateRecipeImage(recipeName, description = '') {
  const prompt = `Professional food photography of ${recipeName}, ${description}, appetizing, restaurant quality, natural lighting`;

  const response = await client.image.generate({
    model: 'flux-schnell',
    prompt,
    width: 1024,
    height: 1024
  });

  return response.imageUrl;
}

async function processRecipes() {
  const headers = { 'Authorization': `Token ${TANDOOR_TOKEN}` };
  const res = await fetch(`${TANDOOR_URL}/api/recipe/?page_size=50`, { headers });
  const data = await res.json();

  const recipesWithoutImages = data.results.filter(r => !r.image);
  console.log(`Processing ${recipesWithoutImages.length} recipes...`);

  for (const recipe of recipesWithoutImages.slice(0, 10)) {
    const imageUrl = await generateRecipeImage(recipe.name, recipe.description);
    console.log(`✅ ${recipe.name} — $0.003`);
  }
}

processRecipes();
Enter fullscreen mode Exit fullscreen mode

Cost Breakdown

Recipes Cost at $0.003/image
10 $0.03
100 $0.30
500 $1.50
1,000 $3.00

For a typical home cookbook of 200-300 recipes, you're looking at under $1 to generate professional food photos for everything.


Why NexaAPI for This Project

  • $0.003/image — the cheapest AI image generation available
  • Flux Schnell model — fast generation, excellent food photography quality
  • 56+ models — switch to SDXL or other models for different styles
  • Available on RapidAPI — easy billing at rapidapi.com/user/nexaquency

Get Started

  1. NexaAPI: nexa-api.com
  2. RapidAPI Hub: rapidapi.com/user/nexaquency
  3. Python SDK: pip install nexaapipypi.org/project/nexaapi
  4. Node.js SDK: npm install nexaapinpmjs.com/package/nexaapi

Keywords: tandoor recipes api, tandoor recipes v2.6.0, ai recipe image generator, food photo generator api, self-hosted recipe app ai, homelab ai integration, generate recipe images automatically

Top comments (0)