1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const axios = require('axios');
const api_key = "YOUR API KEY";
const url = "https://api.segmind.com/workflows/66d6ac02f56156a63306b887-v2";
const data = {
input_image: "publicly accessible image link",
reference_image: "publicly accessible image link",
text_prompt: "the user input string",
select_food_item: "the user input string"
};
axios.post(url, data, {
headers: {
'x-api-key': api_key,
'Content-Type': 'application/json'
}
}).then((response) => {
console.log(response.data);
});
1
2
3
4
5
{
"poll_url": "<base_url>/requests/<some_request_id>",
"request_id": "some_request_id",
"status": "QUEUED"
}
You can poll the above link to get the status and output of your request.
1
2
3
{
"image_ouput": "image in URL Format"
}
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
AI Food Photography is a specialized workflow designed to enhance food images by replacing bland backgrounds with professional-grade scenery. This AI-driven process refines ordinary food photos, making them visually appealing and suitable for various professional uses.
The AI Food Photography workflow utilizes several key components to transform and enhance food images:
Image Node: The process begins with uploading the initial food image, which serves as the primary subject for enhancement.
Automatic Mask Generator: Once the image is uploaded, this node generates a mask of the food item, isolating it from the existing background for further processing.
Fooocus Inpainting: The masked image is processed through the Fooocus Inpainting node. This component intelligently generates a new background that complements the food, providing a professional finish.
Optional Image Prompt: Users can optionally provide an image or text prompt, adding context and thematic elements to guide the background creation.
Clarity Upscaler Model: To ensure that the final image is crisp and high-quality, the Clarity Upscaler Model is applied, enhancing detail and resolution.
Fooocus Outpainting: This final node expands the photo's borders, enhancing the visual appeal and ensuring the image meets professional standards.
Upload Image: Start by uploading the food photo you wish to enhance.
Automatic Mask Generation: The workflow automatically generates a mask to isolate the food from the background.
Background Generation: The masked image, alongside an optional prompt, is fed into the Fooocus Inpainting node to generate a new, captivating background.
Image Upscaling: Utilize the Clarity Upscaler to refine the image quality, ensuring clarity and detail.
Photo Expansion: The Fooocus Outpainting node is then used to expand the image, providing an improved visual presentation.
Food Bloggers: Enhance food images for blogs, ensuring a professional and engaging presentation that attracts readers.
Restaurants and Cafés: Improve the quality of menu images, providing vibrant and enticing visuals for online and print menus.
Marketing Materials: Create stunning food photography for marketing collateral, advertisements, and promotional content.
Cookbook Photography: Generate high-quality images for cookbooks, capturing the essence and appeal of various dishes.
Social Media Content: Craft visually striking food photos for platforms like Instagram, drawing attention and engaging followers.
AI Food Photography provides a streamlined method to elevate food imagery, ensuring that photos stand out in any professional context.