Overview
Thequick_edit function handles the entire Imagen AI workflow in a single call. It automatically creates a project, uploads images, applies AI editing, and optionally exports and downloads the results. Perfect for simple automation scripts and batch processing.
Function Signature
Parameters
Your Imagen AI API key
Profile ID to use for editing. Obtain from
get_profiles().List of local image file paths to upload. All files must be the same type (RAW or JPEG).
Optional name for the project. Must be unique across your account.
Optional photography type for AI optimization. Options:
PhotographyType.PORTRAITSPhotographyType.WEDDINGPhotographyType.EVENTSPhotographyType.REAL_ESTATEPhotographyType.LANDSCAPE_NATUREPhotographyType.FAMILY_NEWBORNPhotographyType.BOUDOIRPhotographyType.SPORTS
Whether to export final JPEG files
Optional editing parameters for customization:
crop: Auto-crop imagesstraighten: Auto-straighten horizonsportrait_crop: Portrait-specific croppingheadshot_crop: Headshot-specific croppingsmooth_skin: Skin smoothing for portraitshdr_merge: HDR bracket mergingsubject_mask: Apply subject maskingperspective_correction: Correct perspectivesky_replacement: Apply sky replacementwindow_pull: Apply window pullcrop_aspect_ratio: Custom aspect ratio
Whether to automatically download edited files
Directory to save downloaded files
Directory for exported files. Defaults to a subdirectory inside
download_dir.API base URL
Optional custom logger for workflow logging
Optional logging level (e.g.,
logging.INFO, logging.DEBUG)Return Value
Complete result object containing:
UUID of the created project
Upload statistics and results:
total: Total number of files attemptedsuccessful: Number of successfully uploaded filesfailed: Number of failed uploadsresults: List of UploadResult objects with details for each file
URLs for downloading XMP files
URLs for downloading JPEG files (if export=True)
Local paths of downloaded XMP files (if download=True)
Local paths of downloaded JPEG files (if export=True and download=True)
Exceptions
UploadError- If no files uploaded successfully or file type validation failsProjectError- If project creation, editing, or export failsAuthenticationError- If API key is invalidDownloadError- If download=True but download fails
Examples
Basic Workflow
Advanced Workflow with Export
With Custom Logging
Download Only Workflow
Export with Custom Directory
Notes
- All files must be the same type (all RAW or all JPEG)
- Project names must be unique across your account
- Setting
download=Trueautomatically downloads both XMP and JPEG files (ifexport=True) - The function validates file types against the profile before uploading
- This function blocks until all operations complete