Relight an image
Relight an image using AI. This endpoint accepts a variety of parameters to customize the generated images.
Important
Upscaler endpoints are only available for premium API users. You can upgrade your account here.
Request
Authorizations
Your Freepik API key. Required for authentication. Learn how to obtain an API key
Headers
The Content-Type
header must be set to application/json
to indicate that the payload is formatted as JSON.
If a different Content-Type
is provided, the payload will be ignored, and the request will proceed without
processing the body.
Body
Webhook URL to receive the relight image once it's ready
Base64 image to do the relight
You can guide the generation process and influence the light transfer with a descriptive prompt. For example, if the reference image is a brightly lit scene, adding something like "A sunlit forest clearing at golden hour" will be helpful.
You can also use your imagination to alter lighting conditions in images: transforming a daytime scene into a moonlit night, enhancing the warmth of a sunset, or even dramatic changes like casting shadows of towering structures across a cityscape.
IMPORTANT: You can emphasize specific aspects of the light in your prompt by using a number in parentheses, ranging from 1 to 1.4, like "(dark scene:1.3)".
Base64 Reference image for light transfer. Incompatible with 'transfer_light_from_lightmap'
Base64 Lightmap for light transfer. Icompatible with 'transfer_light_from_reference_image'
It allows you to specify the level of light transfer, meaning the intensity that your prompt, reference image, or lightmap will have. A value of 0% will keep your image closest to the original, while 100% represents the maximum possible light transfer.
If you enable "Interpolate from original", lower values on this slider will make the result even more similar to your original image.
Valid values range [0, 100]
, default 100
When enabled, this feature will make your final image interpolate from the original using the "Light transfer strength" slider, at the cost of sometimes restricting the generation's freedom.
If disabled, the generation will be freer and will generally produce better results. However, for example, if you want to generate all the frames of a video where a room transitions from having the lights off and very dim lighting to gradually becoming fully illuminated as a new day begins, activating this option might be useful (together with gradually ingreasing the "Light transfer strength" slider).
When enabled, it will change the background based on your prompt and/or reference image. This is super useful for product placement and portraits. However, don’t forget to disable it if your scene is something like a landscape or an interior.
standard
, darker_but_realistic
, clean
, smooth
, brighter
, contrasted_n_hdr
, just_composition
It will try to maintain the texture and small details of the original image. Especially good for product photography, texts, etc. Disable it if you prefer a smoother result.
Response
Was this page helpful?