Generate new images based on reference image with modifications. Use when users request image_to_image operations or related tasks.
Generate new images based on reference image with modifications.
API: tm_reference_img2img
python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET
from scripts.tomoviee_image_to_image_client import TomovieeClient
client = TomovieeClient("app_key", "app_secret")
task_id = client._make_request({
prompt='Woman in business attire, preserve face, change background to office'
reference_image='https://example.com/portrait.jpg'
})
result = client.poll_until_complete(task_id)
import json
output = json.loads(result['result'])
prompt (required): Reference + preserve + modify descriptionreference_image (required): Reference image URLcontrol_type: Control type (0=edge, 1=pose, 2=subject, 3=depth)width/height: Image dimensions (512-2048)batch_size: Number of images (1-4)task_id from API callpoll_until_complete(task_id)Status codes:
tomoviee_image_to_image_client.py - API clientgenerate_auth_token.py - Auth token generatorSee bundled reference documents for detailed API documentation and examples.
ZIP package — ready to use