LimeWire has introduced its AI Studio for creators and artists, along with its RESTful APIs for content creation using leading generative AI models. Developers can now utilize LimeWire’s AI API to create images from text prompts, enhance images, extend images beyond the border, and apply AI-based modifications.
Additionally, LimeWire is working to include API support for music and video generation. This article provides an in-depth review of LimeWire’s AI APIs for various generative AI tasks. Explore our detailed testing of the API to determine if it aligns with your requirements.
Creating Images with LimeWire’s API
Let’s start by looking at the text-to-image endpoint and how you can use the LimeWire AI API to generate images. I’ll be providing examples in Python, but you can also use other languages such as Node.js, PHP, Java, Go, Ruby, and more.
Here’s a Python code sample for generating images:
import requests
url = "https://api.limewire.com/api/image/generation"
payload = {
"prompt": "A dinosaur on the moon",
"aspect_ratio": "1:1"
}
headers = {
"Content-Type": "application/json",
"X-Api-Version": "v1",
"Accept": "application/json",
"Authorization": "Bearer <YOUR_lmwr_sk_*_HERE>"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(data)
In this example, LimeWire’s image generation endpoint (api/image/generation
) is utilized, with the prompt defined in the request body. The prompt must be less than 2,000 characters, and a negative_prompt
can also be provided to specify what should not be included in the image. The aspect_ratio is set to 1:1
, but 2:3
and 3:2
can also be specified.
As this is the initial release of LimeWire’s AI API, the X-Api-version
is indicated as v1. Simply insert your LimeWire API key after “Bearer,” and you’re ready to proceed.
Additionally, there are several other parameters you can include, such as samples
(to generate between 1
to 4
images), quality (to specify desired quality: LOW
, MID
, and HIGH
, with MID
as the default), style (to define the image style: PHOTOREALISTIC
, SCIFI
, LANDSCAPE
), and guidance scale (to instruct the model to strictly adhere to your text prompt, with values from 1
to 100
and 40
as the default). More details can be found on LimeWire’s API documentation page.
You can simply call the API and receive a clean JSON output containing the asset_id
and asset_url
of the image. Generating images using LimeWire’s AI API is that straightforward. LimeWire currently offers support for more than 10 Generative AI models, including BlueWillow (v3, v4, and v5), Dall-E3, Stable Diffusion XL v1.0, Google AI Imagen, and several others.
Enhancing Image Resolution with LimeWire’s API
Next, there’s the API for upscaling images using LimeWire’s api/image/upscaling
endpoint. Here, you’ll need to define the image_asset_id
, which you can generate using the “api/upload” endpoint with a POST request, as explained below. Then, simply specify the upscale_factor
(2
, 3
, or 4
) and include your API key.
import requests
url = "https://api.limewire.com/api/image/upscaling"
payload = {
"image_asset_id": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"upscale_factor": 2
}
headers = {
"Content-Type": "application/json",
"X-Api-Version": "v1",
"Accept": "application/json",
"Authorization": "Bearer <YOUR_lmwr_sk_*_HERE>"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(data)
The API will provide the generated asset_id
along with the asset_url
. In my testing, LimeWire’s API performed excellently. I input a 1000×750 PNG image, and it upscaled the image flawlessly, generating a 2000×1500 image without any artifacts.
It’s common for Diffusion models to struggle with text when upscaling images containing text, often rendering them incorrectly. However, LimeWire’s image upscaling API successfully maintained the integrity of the text in the image, which is remarkable.
Extending Image Boundaries with LimeWire’s API
Moving on to outpainting images, which allows you to extend the boundaries of an image by generating objects and backgrounds that align with the existing content. For this, I’m utilizing LimeWire’s api/image/outpainting
endpoint.
Similar to previous examples, you’ll need to provide the image_asset_id
and include the API key. In this case, the “direction” parameter allows you to specify how you want to expand the image—whether on one side or all directions. You can set direction as UP
, DOWN
, LEFT
, RIGHT
, or ALL
.
import requests
url = "https://api.limewire.com/api/image/outpainting"
payload = {
"image_asset_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
"direction": "UP",
"crop_side": "LEFT"
}
headers = {
"Content-Type": "application/json",
"X-Api-Version": "v1",
"Accept": "application/json",
"Authorization": "Bearer <YOUR_lmwr_sk_*_HERE>"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(data)
Additionally, you can specify the crop_side
to indicate which side to crop for outpainting. While not all images require cropping, the AI models can determine if it’s necessary to enhance the image’s natural appearance. Crop_side options include TOP
, BOTTOM, LEFT
, or RIGHT
. For outpainting, your image should adhere to an aspect ratio of 1:1, 2:3,
or 3:2
.
In my testing, I passed a PNG image with a 1:1
aspect ratio and set the direction
to ALL,
but the processing failed. However, when I requested outpainting for just the upper border of the image, it successfully processed the image, as shown in the example above.
Refining Images with LimeWire’s Inpainting API
Now, let’s discuss inpainting, which allows you to modify an image by providing a text prompt. Simply include a text prompt along with the image, and you can manipulate the image using LimeWire’s AI API. In this case, I’m utilizing the api/image/inpainting
endpoint.
import requests
url = "https://api.limewire.com/api/image/inpainting"
payload = {
"image_asset_id": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"prompt": "Add a tiger on the roof"
}
headers = {
"Content-Type": "application/json",
"X-Api-Version": "v1",
"Accept": "application/json",
"Authorization": "Bearer <YOUR_lmwr_sk_*_HERE>"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(data)
I attempted to use the inpainting API; however, it consistently returned an “Internal Server Error.” It seems that the API may be temporarily unavailable. Nonetheless, this is the general approach for inpainting images using LimeWire’s AI API.
Uploading Assets with LimeWire’s API
Lastly, let’s discuss uploading assets using the LimeWire API. You can utilize the api/upload
endpoint for this purpose. LimeWire retains uploaded assets for 24 hours after they are uploaded, with a maximum upload size of 10MB per image. To upload an image, use the POST request method.
It’s important to note that the Content-Type
parameter should match the image format. Supported image formats include image/png
, image/jpeg
, image/x-ms-bmp
, image/webp
, and image/tiff
.
import requests
url = "https://api.limewire.com/api/upload"
payload = '''
[object Object]
'''
headers = {
"Content-Type": "image/png",
"Authorization": "Bearer <YOUR_lmwr_sk_*_HERE>"
}
response = requests.post(url, data=payload, headers=headers)
data = response.json()
print(data)
Is the LimeWire AI API Worth Using?
In terms of performance, LimeWire’s Generative API tools are impressive. Built on the REST architecture, they are scalable and deliver excellent performance. In my testing, API calls were resolved in 4 to 5 seconds, which is remarkable. Additionally, the quality of generated content is high, thanks to the state-of-the-art Diffusion models from vendors like OpenAI, Stability AI, Google, and others.
The API implementation is user-friendly, making it easy for anyone to get started in any environment. The documentation is concise and straightforward. Despite being the first release, LimeWire’s AI API offers several customization options, allowing you to tailor the generated content to your preferences.
In terms of pricing, LimeWire offers a single plan for all APIs, unlike competitors who offer multiple plans for different functionalities. The API Pro plan allows you to generate up to 7,500 images per month with 4 concurrent requests, priced at $49 per month, which is quite reasonable. This plan is suitable for developers and small businesses.
Alternatively, you can consider the API Basic plan, priced at $29.99 per month for 3,750 images, or the API Pro Plus plan, priced at $250 per month for 37,500 images.
0 Comments