Effortlessly Generate Stunning Images with Aurore Team's Inpainting Action

25 Apr 2025
Effortlessly Generate Stunning Images with Aurore Team's Inpainting Action

In the world of digital content creation, the ability to quickly generate high-quality images can significantly enhance productivity and creativity. The Aurore Team offers a powerful set of Cognitive Actions designed to streamline this process, particularly through its Inpainting feature. This action enables developers to generate images with remarkable detail and precision, allowing for customizable prompts and image modifications. Whether you are creating visuals for marketing campaigns, enhancing user interfaces, or generating unique artwork, Aurore Team's Inpainting action provides an efficient solution that combines speed with flexibility.

Developers can leverage this action in various scenarios, such as designing promotional materials that require specific imagery, creating concept art for games or films, or even generating personalized images for users. By utilizing the inpainting capabilities, users can easily adapt existing images or create entirely new visuals based on detailed descriptions, leading to a more engaging user experience.

Generate Image with Inpainting

The "Generate Image with Inpainting" action allows users to create images by combining the power of AI with inpainting techniques. This action is particularly useful when you need to modify existing images or generate new ones based on specific prompts, making it an essential tool for creative projects.

Input Requirements

To use this action, you need to provide a set of inputs, including:

  • Prompt: A textual description of the desired image, which can trigger specific styles or objects from the model's training.
  • Image: A URI of the input image for inpainting or image-to-image generation.
  • Mask: A URI of the image mask that defines areas to be modified during the inpainting process.
  • Width & Height: Dimensions for the generated image, applicable only when a custom aspect ratio is set.
  • Model Type: Choose between 'dev' for detailed generation or 'schnell' for faster results.
  • Lora Weights: Options to specify custom LoRA weights for unique styling.

Expected Output

The output of this action will be one or more generated images based on the inputs provided. The images are generated in the specified format (e.g., webp, jpg, png) and can be customized for quality and size.

Use Cases for this Specific Action

  • Marketing and Advertising: Quickly generate tailored visuals for campaigns that resonate with target audiences.
  • Art and Design: Create unique artworks by describing scenes or subjects, enabling artists to explore new ideas without starting from scratch.
  • Game Development: Develop concept art or assets that fit specific themes or narratives, enhancing the visual storytelling of games.
import requests
import json

# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"

action_id = "aa8ee5a5-c81a-4251-afa7-db5935b868d1" # Action ID for: Generate Image with Inpainting

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "mask": "https://replicate.delivery/pbxt/LzdYZpA1tj9WO7kULSmVUk2obYGfE0XyXktNNzHLV9F3TtcA/aurore-team-7%20bw.png",
  "image": "https://replicate.delivery/pbxt/LzdYaW2LffpSphmGj5kUMBuMrPKIKmK3fXJREMKCJpfHxmbr/aurore-team-7%20-9%2016.png",
  "prompt": "A highly detailed fashion runway scene featuring three stylish women standing confidently, captured from an overhead angle to emphasize their flow, motion, and elegant high heels. The women are positioned on a sleek, reflective runway surface, which mirrors the soft glow of hidden ambient lighting. Their outfits contrast beautifully: one in a casual denim and blue shirt ensemble, the second in a chic black crop top with white pants, and the third in a glamorous black evening dress with feather accents. Each outfit is perfectly styled to showcase their unique personalities and complement the high-fashion setting.\n\nThe background consists of dark silhouettes of thuja trees that create a natural pathway framing the runway. , adding an air of mystery and sophistication to the scene. Soft mist swirls gently at their feet, blending seamlessly with the runway's glossy texture, creating a surreal, dreamlike effect.\n\nThe lighting is diffused and cinematic, coming from above to highlight the models' silhouettes and the flowing fabrics of their clothing. The overall atmosphere is a blend of elegance and mysticism, capturing the essence of a high-end fashion show in a natural yet surreal setting.",
  "modelType": "dev",
  "mainLoraScale": 0.7,
  "extraLoraScale": 1.03,
  "promptStrength": 0.75,
  "numberOfOutputs": 2,
  "imageAspectRatio": "9:16",
  "imageOutputFormat": "webp",
  "imageGuidanceScale": 3,
  "imageOutputQuality": 90,
  "inferenceStepsCount": 28
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json",
    # Add any other required headers for the Cognitive Actions API
}

# Prepare the request body for the hypothetical execution endpoint
request_body = {
    "action_id": action_id,
    "inputs": payload
}

print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json=request_body
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully. Result:")
    print(json.dumps(result, indent=2))

except requests.exceptions.RequestException as e:
    print(f"Error executing action {action_id}: {e}")
    if e.response is not None:
        print(f"Response status: {e.response.status_code}")
        try:
            print(f"Response body: {e.response.json()}")
        except json.JSONDecodeError:
            print(f"Response body (non-JSON): {e.response.text}")
    print("------------------------------------------------")

Conclusion

The Aurore Team's Inpainting action serves as a powerful asset for developers looking to enhance their creative capabilities. By enabling the generation of high-quality images based on detailed prompts and existing visuals, this action streamlines workflows and fosters innovation in various fields. Whether you are working on marketing materials, artistic projects, or game development, integrating this action can significantly boost your productivity and creativity. Start exploring the possibilities today and take your visual content to the next level!