Create Stunning Images with Cognitive Actions: A Guide to Blueberry3SSFinal

24 Apr 2025
Create Stunning Images with Cognitive Actions: A Guide to Blueberry3SSFinal

In the world of digital content creation, generating high-quality images quickly and efficiently can significantly enhance user engagement and provide unique visual experiences. The gastonmiguelartillo/blueberry3ssfinal API offers a powerful Cognitive Action to help developers create hyper-realistic images using advanced inpainting or image-to-image techniques. This guide will walk you through the capabilities of the Generate Image with Mask and Parameters action, detailing how to integrate it into your applications.

Prerequisites

Before you can start using the Cognitive Actions, ensure you have the following:

  • API Key: You'll need an API key to access the Cognitive Actions platform. Typically, this key is passed in the request headers.
  • Basic Knowledge of HTTP Requests: Familiarity with making API calls, especially using JSON payloads, will be beneficial.

You can authenticate your requests by passing the API key in the headers of your HTTP requests.

Cognitive Actions Overview

Generate Image with Mask and Parameters

The Generate Image with Mask and Parameters action allows you to generate hyper-realistic images with extensive customization options. This includes the ability to specify a mask, an image prompt, and various output settings like format and quality. The schnell model enhances the speed of image generation, reducing the inference steps to just four while maintaining high quality.

Input

The input for this action is structured as follows:

{
  "prompt": "Your detailed image description here...",
  "model": "dev",
  "imageFormat": "webp",
  "imageQuality": 80,
  "loraStrength": 1,
  "acceleratedMode": false,
  "imageMegapixels": "1",
  "numberOfOutputs": 1,
  "promptInfluence": 0.8,
  "imageAspectRatio": "1:1",
  "inferenceStepsCount": 28,
  "additionalLoraStrength": 1,
  "diffusionGuidanceScale": 3
}

Example Input:

{
  "model": "dev",
  "prompt": "Hyper-Realistic Summer Explosion – Blueberry & Vanilla Beer Can\n\nA vibrant, hyper-realistic product shot of a craft beer can erupting in a dynamic explosion of fresh blueberry juice and delicate vanilla flowers, capturing the essence of summer freshness...",
  "imageFormat": "webp",
  "imageQuality": 80,
  "loraStrength": 1,
  "acceleratedMode": false,
  "imageMegapixels": "1",
  "numberOfOutputs": 1,
  "promptInfluence": 0.8,
  "imageAspectRatio": "1:1",
  "inferenceStepsCount": 28,
  "additionalLoraStrength": 1,
  "diffusionGuidanceScale": 3
}

Output

Upon successful execution, the action typically returns a URL pointing to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/67fa0b5c-a69a-4958-a327-4579377c8b05/4284b175-e296-42d6-afeb-f15c7669d0d4.webp"
]

This URL can be used to access the resulting image directly.

Conceptual Usage Example (Python)

Here’s how you could conceptually implement a call to this action using Python:

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 = "5e8b3d7d-3309-4bb2-b6ac-3dd87b23035d"  # Action ID for Generate Image with Mask and Parameters

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "prompt": "Hyper-Realistic Summer Explosion – Blueberry & Vanilla Beer Can\n\nA vibrant, hyper-realistic product shot of a craft beer can erupting in a dynamic explosion of fresh blueberry juice and delicate vanilla flowers...",
    "imageFormat": "webp",
    "imageQuality": 80,
    "loraStrength": 1,
    "acceleratedMode": False,
    "imageMegapixels": "1",
    "numberOfOutputs": 1,
    "promptInfluence": 0.8,
    "imageAspectRatio": "1:1",
    "inferenceStepsCount": 28,
    "additionalLoraStrength": 1,
    "diffusionGuidanceScale": 3
}

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, you replace the placeholder API key and ensure the action ID corresponds to the action you want to execute. The payload reflects the required structure as outlined in the input schema.

Conclusion

The gastonmiguelartillo/blueberry3ssfinal API offers developers a robust tool for generating stunning images tailored to specific needs. By leveraging the Generate Image with Mask and Parameters action, you can create eye-catching visuals that enhance your applications. Consider experimenting with various prompts and configurations to discover the full capabilities of this powerful Cognitive Action. Happy coding!