Ai Home Image to Image
About
🎨 General Image Styling - Flexible AI-powered image modifications
Apply a wide range of edits to images including: • Color adjustments (brightness, contrast, saturation) • Object additions/removals (add/remove furniture, decor) • Style transformations (change art style, apply filters) • Background modifications (replace or enhance backgrounds)
Perfect for: Photo retouching, creative image manipulation, design concepts
⚡ Versatile editing capabilities for diverse use cases 🎯 Customizable prompts for precise control over edits
1. Calling the API#
Install the client#
The client provides a convenient way to interact with the model API.
npm install --save @fal-ai/clientMigrate to @fal-ai/client
The @fal-ai/serverless-client package has been deprecated in favor of @fal-ai/client. Please check the migration guide for more information.
Setup your API Key#
Set FAL_KEY as an environment variable in your runtime.
export FAL_KEY="YOUR_API_KEY"Submit a request#
The client API handles the API submit protocol. It will handle the request status updates and return the result when the request is completed.
import { fal } from "@fal-ai/client";
const result = await fal.subscribe("half-moon-ai/ai-home/style", {
input: {
input_image_url: "https://v3.fal.media/files/kangaroo/BLwbXwxQI_MNwUF-P6ITl_zen_living_room_input.jpg",
architecture_type: "living room-interior",
style: "rustic-interior",
color_palette: "golden beige"
},
logs: true,
onQueueUpdate: (update) => {
if (update.status === "IN_PROGRESS") {
update.logs.map((log) => log.message).forEach(console.log);
}
},
});
console.log(result.data);
console.log(result.requestId);2. Authentication#
The API uses an API Key for authentication. It is recommended you set the FAL_KEY environment variable in your runtime when possible.
API Key#
import { fal } from "@fal-ai/client";
fal.config({
credentials: "YOUR_FAL_KEY"
});Protect your API Key
When running code on the client-side (e.g. in a browser, mobile app or GUI applications), make sure to not expose your FAL_KEY. Instead, use a server-side proxy to make requests to the API. For more information, check out our server-side integration guide.
3. Queue#
Submit a request#
The client API provides a convenient way to submit requests to the model.
import { fal } from "@fal-ai/client";
const { request_id } = await fal.queue.submit("half-moon-ai/ai-home/style", {
input: {
input_image_url: "https://v3.fal.media/files/kangaroo/BLwbXwxQI_MNwUF-P6ITl_zen_living_room_input.jpg",
architecture_type: "living room-interior",
style: "rustic-interior",
color_palette: "golden beige"
},
webhookUrl: "https://optional.webhook.url/for/results",
});Fetch request status#
You can fetch the status of a request to check if it is completed or still in progress.
import { fal } from "@fal-ai/client";
const status = await fal.queue.status("half-moon-ai/ai-home/style", {
requestId: "764cabcf-b745-4b3e-ae38-1200304cf45b",
logs: true,
});Get the result#
Once the request is completed, you can fetch the result. See the Output Schema for the expected result format.
import { fal } from "@fal-ai/client";
const result = await fal.queue.result("half-moon-ai/ai-home/style", {
requestId: "764cabcf-b745-4b3e-ae38-1200304cf45b"
});
console.log(result.data);
console.log(result.requestId);4. Files#
Some attributes in the API accept file URLs as input. Whenever that's the case you can pass your own URL or a Base64 data URI.
Data URI (base64)#
You can pass a Base64 data URI as a file input. The API will handle the file decoding for you. Keep in mind that for large files, this alternative although convenient can impact the request performance.
Hosted files (URL)#
You can also pass your own URLs as long as they are publicly accessible. Be aware that some hosts might block cross-site requests, rate-limit, or consider the request as a bot.
Uploading files#
We provide a convenient file storage that allows you to upload files and use them in your requests. You can upload files using the client API and use the returned URL in your requests.
import { fal } from "@fal-ai/client";
const file = new File(["Hello, World!"], "hello.txt", { type: "text/plain" });
const url = await fal.storage.upload(file);Auto uploads
The client will auto-upload the file for you if you pass a binary object (e.g. File, Data).
Read more about file handling in our file upload guide.
5. Schema#
Input#
input_image_url string* requiredURL of the image to do architectural styling
style_image_url stringURL of the style image, optional. If given, other parameters are ignored Default value: ""
architecture_type ArchitectureTypeEnum* requiredType of architecture for appropriate furniture selection
Possible enum values: living room-interior, bedroom-interior, kitchen-interior, dining room-interior, bathroom-interior, laundry room-interior, home office-interior, study room-interior, dorm room-interior, coffee shop-interior, gaming room-interior, restaurant-interior, office-interior, attic-interior, toilet-interior, other-interior, house-exterior, villa-exterior, backyard-exterior, courtyard-exterior, ranch-exterior, office exterior, retail-exterior, tower-exterior, apartment-exterior, school-exterior, museum-exterior, commercial-exterior, residential-exterior, other-exterior
style StyleEnum* requiredStyle for furniture and decor
Possible enum values: minimalistic-interior, farmhouse-interior, luxury-interior, modern-interior, zen-interior, mid century-interior, airbnb-interior, cozy-interior, rustic-interior, christmas-interior, bohemian-interior, tropical-interior, industrial-interior, japanese-interior, vintage-interior, loft-interior, halloween-interior, soho-interior, baroque-interior, kids room-interior, girls room-interior, boys room-interior, scandinavian-interior, french country-interior, mediterranean-interior, cyberpunk-interior, hot pink-interior, biophilic-interior, ancient egypt-interior, pixel-interior, art deco-interior, modern-exterior, minimalistic-exterior, farmhouse-exterior, cozy-exterior, luxury-exterior, colonial-exterior, zen-exterior, asian-exterior, creepy-exterior, airstone-exterior, ancient greek-exterior, art deco-exterior, brutalist-exterior, christmas lights-exterior, contemporary-exterior, cottage-exterior, dutch colonial-exterior, federal colonial-exterior, fire-exterior, french provincial-exterior, full glass-exterior, georgian colonial-exterior, gothic-exterior, greek revival-exterior, ice-exterior, italianate-exterior, mediterranean-exterior, midcentury-exterior, middle eastern-exterior, minecraft-exterior, morocco-exterior, neoclassical-exterior, spanish-exterior, tudor-exterior, underwater-exterior, winter-exterior, yard lighting-exterior
color_palette ColorPaletteEnum* requiredColor palette for furniture and decor
Possible enum values: surprise me, golden beige, refined blues, dusky elegance, emerald charm, crimson luxury, golden sapphire, soft pastures, candy sky, peach meadow, muted sands, ocean breeze, frosted pastels, spring bloom, gentle horizon, seaside breeze, azure coast, golden shore, mediterranean gem, ocean serenity, serene blush, muted horizon, pastel shores, dusky calm, woodland retreat, meadow glow, forest canopy, riverbank calm, earthy tones, earthy neutrals, arctic mist, aqua drift, blush bloom, coral haze, retro rust, autumn glow, rustic charm, vintage sage, faded plum, electric lime, violet pulse, neon sorbet, aqua glow, fluorescent sunset, lavender bloom, petal fresh, meadow light, sunny pastures, frosted mauve, snowy hearth, icy blues, winter twilight, earthy hues, stone balance, neutral sands, slate shades
additional_elements stringAdditional elements to include in the options above (e.g., plants, lighting) Default value: ""
custom_prompt stringCustom prompt for architectural editing, it overrides above options when used Default value: ""
output_format OutputFormatEnumThe format of the generated image. Choose from: 'jpeg' or 'png'. Default value: "jpeg"
Possible enum values: jpeg, png
{
"input_image_url": "https://v3.fal.media/files/kangaroo/BLwbXwxQI_MNwUF-P6ITl_zen_living_room_input.jpg",
"architecture_type": "living room-interior",
"style": "rustic-interior",
"color_palette": "golden beige",
"custom_prompt": "",
"output_format": "jpeg"
}Output#
Generated image
status string* requiredStatus message with processing details
{
"image": {
"content_type": "image/jpeg",
"url": "https://angeneral.com/serverless/sync-1d728c05-fc7c-44f3-8214-b23e69f7617c-u1/4e35cb24-4650-47f3-9dcc-026c418deca4.jpg"
},
"status": ""
}Other types#
Image#
url string* requiredThe URL where the file can be downloaded from.
content_type stringThe mime type of the file.
file_name stringThe name of the file. It will be auto-generated if not provided.
file_size integerThe size of the file in bytes.
width integerThe width of the image in pixels.
height integerThe height of the image in pixels.