Generate beautiful AI images for your website with simple HTML attributes.
Add PlaceholderGen to your website with a simple script tag
To start using PlaceholderGen, include the following script in the head
section of your HTML:
Include this script in your HTML head section
Replace _YOUR_AUTH_KEY_
with your actual authentication token from the dashboard.
Understanding the different types of authentication tokens
The development token offers full read and write access to our API. It doesn't check the domain where it's used, making it ideal for local development and testing.
Optimize performance by controlling how image URLs are cached
By default, PlaceholderGen caches image URLs to improve performance and reduce unnecessary server requests. This means that once an image URL has been fetched for a specific prompt, it will be reused from the cache when the page is refreshed.
Disabling Cache
In some scenarios, you may want to disable caching - especially when generating new variations of images and wanting to see immediate changes. To disable caching, set the cacheEnabled
property to false
in the configuration:
Script with caching disabled
Customize your image generation with these simple HTML attributes
pgen-prompt
The text description of the image you want to generate. Be as descriptive as possible for best results. Must be at least 20 characters long.
pgen-model
The AI model to use for image generation. Currently supports 'stable-diffusion' and 'dall-e'. More AI models will be added based on user demand.
pgen-ratio
The aspect ratio of the generated image. Options are 'square', 'landscape', or 'portrait'.
pgen-size
Custom image dimensions in the format 'widthxheight' (e.g., '300x500'). This feature is only available for users with an active subscription.
Understanding how the coin system works for subscriptions and purchases
Coins are the currency used to generate images on PlaceholderGen. There are two types of coins: subscription coins and purchased coins, each with different expiration rules.
Subscription Coins
Subscription coins are included with your subscription plan and are renewed at the beginning of each billing cycle. Any unused subscription coins do not roll over to the next billing cycle.
Purchased Coins
Purchased coins are additional coins you buy separately from your subscription. These coins expire 3 months from the date of purchase.
You can view your current coin balance and expiration dates in your account dashboard.
See how to implement PlaceholderGen in your HTML
HTML Implementation Examples
Visual Examples
Example: A beautiful mountain landscape at sunset
HTML code:
Example: An astronaut riding a horse on Mars
HTML code:
Example: A futuristic cityscape
HTML code:
Example: A vintage car on a coastal road
HTML code: