Generate Stunning Interior Designs with rihan-a/colourful_interiors Cognitive Actions

21 Apr 2025
Generate Stunning Interior Designs with rihan-a/colourful_interiors Cognitive Actions

In the world of interior design, inspiration and creativity play pivotal roles. The rihan-a/colourful_interiors API offers a powerful Cognitive Action that lets developers transform their design visions into vibrant realities. This API is meticulously trained on modern interiors featuring exquisite designer furniture, providing stylish and sophisticated ideas to inspire any space. By leveraging these pre-built actions, developers can enhance their applications with dynamic image generation capabilities, making it easier to visualize design concepts.

Prerequisites

Before diving into the Cognitive Actions, ensure you have:

  • An API key for accessing the Cognitive Actions platform.
  • Familiarity with making API calls and handling JSON payloads.

Authentication typically involves passing your API key in the headers of your requests.

Cognitive Actions Overview

Generate Vibrant Interior Design Ideas

Description: Transform your design visions into reality using this AI model, meticulously trained on vibrant, modern interiors. It provides colorful, stylish, and sophisticated ideas to inspire any space.

Category: Image Generation

Input

The action requires a JSON object input, where the prompt field is mandatory. Here’s the schema for the input:

{
  "prompt": "string",
  "mask": "string (uri)",
  "seed": "integer",
  "image": "string (uri)",
  "model": "string (enum: ['dev', 'schnell'])",
  "width": "integer",
  "height": "integer",
  "megapixels": "string (enum: ['1', '0.25'])",
  "customWeights": "string",
  "guidanceScale": "number",
  "enableFastMode": "boolean",
  "loraWeightScale": "number",
  "numberOfOutputs": "integer",
  "imageAspectRatio": "string (enum: ['1:1', '16:9', ..., 'custom'])",
  "imageOutputFormat": "string (enum: ['webp', 'jpg', 'png'])",
  "imageOutputQuality": "integer",
  "additionalLoraScale": "number",
  "imagePromptStrength": "number",
  "additionalLoraWeights": "string",
  "safetyCheckerDisabled": "boolean",
  "numberOfInferenceSteps": "integer"
}

Example Input:

{
  "model": "dev",
  "width": 800,
  "height": 600,
  "prompt": "modern seating area, pink velvet curved sofa, orange tulip table, minimalistic decor, soft lighting, light wooden floor, beige walls, playful and bold colour scheme",
  "megapixels": "1",
  "guidanceScale": 3,
  "enableFastMode": false,
  "loraWeightScale": 1,
  "numberOfOutputs": 1,
  "imageAspectRatio": "1:1",
  "imageOutputFormat": "jpg",
  "imageOutputQuality": 80,
  "additionalLoraScale": 1,
  "imagePromptStrength": 0.8,
  "numberOfInferenceSteps": 28
}

Output

The action typically returns an array of image URLs based on your input. Here’s an example of the output:

[
  "https://assets.cognitiveactions.com/invocations/f8277348-a9f9-4d0b-9ea3-75185826376b/9d5b5375-b651-4d21-8b7b-f8f7afaf7cdd.jpg"
]

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet demonstrating how to call this Cognitive Action:

import requests
import json

# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"  # Hypothetical endpoint

action_id = "24429925-def2-4d89-9b85-5abbc22dfe43"  # Action ID for Generate Vibrant Interior Design Ideas

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "width": 800,
    "height": 600,
    "prompt": "modern seating area, pink velvet curved sofa, orange tulip table, minimalistic decor, soft lighting, light wooden floor, beige walls, playful and bold colour scheme",
    "megapixels": "1",
    "guidanceScale": 3,
    "enableFastMode": False,
    "loraWeightScale": 1,
    "numberOfOutputs": 1,
    "imageAspectRatio": "1:1",
    "imageOutputFormat": "jpg",
    "imageOutputQuality": 80,
    "additionalLoraScale": 1,
    "imagePromptStrength": 0.8,
    "numberOfInferenceSteps": 28
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json"
}

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json={"action_id": action_id, "inputs": payload}  # Hypothetical structure
    )
    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully:")
    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: {e.response.text}")

In this example, replace the placeholders with your API key and make sure the action ID corresponds to the action you want to execute. The input payload aligns with the schema requirements, allowing you to generate vibrant interior design images.

Conclusion

The rihan-a/colourful_interiors Cognitive Action provides a fantastic way to generate stunning interior design ideas effortlessly. By integrating these capabilities into your application, you can offer users a unique and creative platform for visualizing their design aspirations. Consider exploring additional features and customizing your image generation process to suit various design needs. Happy coding!