- Overview
- Introduction
- Hosts
- Global Headers
- Common HTTP Error Codes
- API Permits
- Authorization
- API Contexts
- Common Concepts
- Common Models
- Reference
- API Structure
- Public API
- Introduction
- Loyalty Club
- Member
- Offers
- Rewards
- Games
- CMS Content
- Management API
- Introduction
- Core
- Applications
- Privacy Policy
- Cookie Policy
- Terms
- Domains
- Domain Email Configs
- Domain Web Configs
- TLS Certificates
- Links
- Fonts
- Subunits
- Subunits Scopes
- SMS Sender Identities
- Contacts
- Translations
- Promotions Policy
- Tracker
- Social Logins
- Billing
- Members
- Listing Members
- Member Profile
- Imports
- Groups
- Programs
- Benefits
- Cars
- Webhooks
- Misc
- Receipts
- Stores
- Offers
- Rewards
- Triggerer
- CMS
- Introduction
- Pages
- Components
- Website
- Website Domains
- Venue Info
- Landing Pages
- Landing Page Templates
- Articles
- Events
- Events Groups
- Job Postings
- Press Releases
- Tags
- Service Messages
- Content Prototypes
- ContentPrototype Model
- List Content Prototypes
- Show Content Prototype
- Create Content Prototype
- Update Content Prototype
- Destroy Content Prototype
- List Organization Content Prototypes
- Show Organization Content Prototype
- Create Organization Content Prototype
- Update Organization Content Prototype
- Destroy Organization Content Prototype
- Mixed Content
- Attachments
- Events
- Games
- Scraper
- Files
- Receipts
- Users API
- Operations API
- Introduction
- Manager API
- Tenant API
- Messaging API
- Data API
- ML API
- Introduction
- Predict Sending KPI v1POST
- Explain Sending KPI Prediction v1POST
- Predict Sending KPI In Date Range v1POST
- Predict Sending Popularity v2POST
- Predict Sending Text Popularity v2POST
- Predict Sending Time Series Popularity v2POST
- Explain Sending Popularity Prediction v2POST
- Explain Sending Text Popularity Prediction v2POST
- Explain Sending Time Series Popularity Prediction v2POST
- Recommend sending time v2POST
- Generate ImagePOST
- Generate TextPOST
- Generate Sending TextPOST
- (Draft) Reporting API
- Other
Generate Image
POST
https://api.mpc.dev.placewise.com/v1/ml/general/generate_image
API Permit:ML:ImageGeneration:Post
API Context:Loyalty Club
Authorizations:UserToken
Body Parameters#
Parameter | Type | Required? | Description |
---|---|---|---|
prompt | String | yes | Image generation prompt. |
model_type | String | no (default "small") | Model type, one of: "small", "medium", "large". Larger models have higher quality, longer generation time, and higher cost. |
aspect_ratio | String | no (default "1:1") | Image aspect ratio, one of: "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "16:9", "9:16". |
image_size | String | no (default "thumbnail") | Image size, one of: "thumbnail" (256 px), "small" (512 px), "medium" (1024 px), "large" (1440 px). |
creativity | Integer | no (default 2) | Variability and creativity of image generation. Only used in "medium" and "large" models. |
photorealistic | Boolean | no (default false) | If true, generate photorealistic images. Only used in "large" model. |
random_seed | Integer | no (default null) | If set, it results in deterministic generation. |
Warning: for model size "small", image size must be "thumbnail" or "medium"' |
Example#
When successful, returns:
{
'image_generation_task': {
'id': 1
}
}
Request
Header Params
X-Loyalty-Club-Slug
stringÂ
required
Default:
{{LOYALTY_CLUB_SLUG}}
X-Client-Authorization
stringÂ
optional
Default:
{{API_TOKEN}}
Body Params multipart/form-data
prompt
stringÂ
optional
Example:
Minimalistic cheesecake cartoon image
model_type
stringÂ
optional
Example:
small
aspect_ratio
stringÂ
optional
Example:
1:1
image_size
stringÂ
optional
Example:
thumbnail
creativity
integerÂ
optional
Example:
2
photorealistic
booleanÂ
optional
Example:
false
random_seed
integerÂ
optional
Example:
1
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mpc.dev.placewise.com/v1/ml/general/generate_image' \
--header 'X-User-Agent;' \
--header 'X-Product-Name;' \
--header 'X-Loyalty-Club-Slug;' \
--header 'X-Customer;' \
--header 'Authorization;' \
--header 'X-Client-Authorization: ' \
--form 'prompt="Minimalistic cheesecake cartoon image"' \
--form 'model_type="small"' \
--form 'aspect_ratio="1:1"' \
--form 'image_size="thumbnail"' \
--form 'creativity="2"' \
--form 'photorealistic="false"' \
--form 'random_seed="1"'
Responses
🟢200Success
application/json
Body
image_generation_task
objectÂ
required
id
integerÂ
required
Example
{
"image_generation_task": {
"id": 0
}
}
Modified at 2025-04-14 10:25:30