Prompt
QR Code
Output
On-demand price is $0.00015 / step.

Please wait a few seconds for your workspace to be created.Refresh

Login to get your token

And use it in the following codes.

import os
import base64
from leptonai.client import Client

api_token = os.environ.get('LEPTON_API_TOKEN')
c = Client("https://aiqr.lepton.run", token=api_token)

# List available models
print("==== Available models ====")
models = c.models()

model = models[0]

control_image="https://lepton.ai/playground/stablediffusion/illusion/lepton.png"
listOfImageBase64 = c.generate(
    control_image=control_image,
    prompt="a architectural drawing of a new town square for Cambridge England, big traditional musuem with columns, fountain in middle, classical design, traditional design, trees",
    model=model,
    control_image_ratio=0.75,
    control_weight=0.9,
    guidance_start=0.3,
    guidance_end=0.95,
    seed=-1,
    steps=30,
    cfg_scale=7
)

for idx, imageBase64 in enumerate(listOfImageBase64):
    with open(f'output_art_qrcode_image_{idx}.png', 'wb') as f:
        f.write(base64.b64decode(imageBase64))
    print(f"Image saved as output_image_{idx}.png")

The rate limit for the Model APIs is 10 requests per minute across all models under Basic Plan. For the pricing plan, you may check out pricing page, If you need a higher rate limit with SLA or dedicated deployment, please contact us.