Image enhancement

Replace the sky in an exterior photo

Swaps a dull or overcast sky for a chosen style. Costs 1 credit. Responds in ~10s.

post/api/sky_blue

Request

  • Base URL: https://app.pedra.ai
  • URL: https://app.pedra.ai/api/sky_blue
  • Auth: none required

Request body

apiKeystring required

Account API key, sent in the request body. Get one at https://app.pedra.ai under Settings → API.

imageUrlstring required

A publicly accessible HTTPS image URL or a base64 data URI (data:image/png;base64,...). Remote URLs are fetched within ~20s; use base64 for auth-walled or short-lived presigned URLs.

skyStyle'sunny' | 'sunny-no-reflections' | 'sunrise' | 'dawn' | 'night'

Target sky look.

preserveAspectRatioboolean

By default, the output comes back at whatever size the AI model produces, which may not match the aspect ratio or resolution of your photo. Set to true to get the result at the exact width and height of the input image: it is center-cropped to the original aspect ratio (never stretched) and resized to the original resolution.

propertyIdstring

Optional id of the property (from /api/list_properties or /api/create_property) this photo/video belongs to. When set, the result is saved into that property's gallery (or, for create_video, its Videos tab) — visible and editable from the app — instead of only being returned as a URL.

namestring

Optional name for the original photo (e.g. its file name). Requires propertyId. If the photo isn't in that property yet, it is saved there under this name in the same call (no need to call add_images_to_property first) and returned as source.name. A photo already in the property keeps its current name. Never drawn on the image.

Example request

{
  "imageUrl": "https://example.com/photo.jpg"
}

Response

Success. output is a single generated image.

messagestring

Example response

{
  "message": "Success",
  "output": {
    "url": "https://img.pedra.ai/generated-id"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.