Create Stunning High-Resolution Images with Stable Diffusion

27 Apr 2025
Create Stunning High-Resolution Images with Stable Diffusion

In the world of digital content creation, visual appeal is paramount. The "Stable Diffusion High Resolution" service offers developers a powerful tool to generate stunning, high-resolution images that captivate and engage audiences. By leveraging advanced AI techniques, including GOBIG mode and the Real-ESRGAN upscaler, this service simplifies the image generation process, allowing you to create detailed artwork from simple text prompts.

Imagine transforming a creative idea into a vivid visual representation in just a few steps. Whether you're working on marketing materials, game assets, or artistic projects, this service can enhance your workflow and reduce the time spent on image creation.

Prerequisites

Before diving into the capabilities of the Stable Diffusion High Resolution service, ensure you have a Cognitive Actions API key and a basic understanding of API calls to facilitate seamless integration.

Generate High-Resolution Images with Stable Diffusion

This action enables you to create detailed, high-resolution images using the Stable Diffusion algorithm. By generating an initial image from a specified prompt and refining it through advanced upscaling and blending techniques, you can achieve exceptional visual quality that meets the demands of any project.

Input Requirements

To utilize this action, you will need to provide the following parameters:

  • Seed: An integer value for reproducible sampling.
  • Scale: A number, typically set to 7.5, that dictates the unconditional guidance scale for the sampling process.
  • Steps: An integer representing the number of steps in the rendering process, with a default of 50.
  • Prompt: A descriptive text guiding the image generation, such as "female cyborg assimilated by alien fungus, intricate Three-point lighting portrait."
  • Original Width: An integer that defines the original image width (options available: 128, 256, 512, 768, 1024).
  • Original Height: An integer that defines the original image height (options available: 128, 256, 512, 768, 1024).

Expected Output

The output will be a high-resolution image URL that showcases the generated artwork, allowing for easy integration into your projects.

Example Input:

{
  "scale": 7.5,
  "steps": 50,
  "prompt": "female cyborg assimilated by alien fungus, intricate Three-point lighting portrait, by Ching Yeh and Greg Rutkowski, detailed cyberpunk in the style of GitS 1995",
  "originalWidth": 512,
  "originalHeight": 512
}

Example Output:https://assets.cognitiveactions.com/invocations/8941eba1-8dbe-468d-b2ad-0365dc8c3791/24aa520f-0e41-429c-a196-f460a82a8023.png

Use Cases for this Specific Action

  • Marketing and Advertising: Create eye-catching visuals for campaigns that require unique and high-quality images.
  • Game Development: Generate assets that enhance the visual storytelling aspect of your games.
  • Artistic Projects: Allow artists to explore new styles and concepts without extensive manual rendering work.
  • Content Creation: Provide bloggers, vloggers, and social media influencers with original images that stand out and attract attention.
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 = "c30453e2-8122-4dac-a3c0-14d8820c78a2" # Action ID for: Generate High-Resolution Images with Stable Diffusion

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "scale": 7.5,
  "steps": 50,
  "prompt": "female cyborg assimilated by alien fungus, intricate Three-point lighting portrait, by Ching Yeh and Greg Rutkowski, detailed cyberpunk in the style of GitS 1995",
  "originalWidth": 512,
  "originalHeight": 512
}

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 Stable Diffusion High Resolution service empowers developers to create stunning, high-quality images quickly and efficiently. By simplifying the image generation process, it opens up a world of possibilities for various applications, from marketing to game design. As you integrate this service into your projects, you'll find that the ability to generate intricate visuals on demand can significantly enhance your creative output. Start experimenting with high-resolution image generation today and elevate your content to new heights!