Text to Image

Generates an image by a text prompt

Input

This task allows to create an image by a prompt that describes an image.

[1.0.0]:
First release
VersionAI ModelCreatedLink
1.0.0ai-forever/kandinsky-228.03.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • prompt (Image prompt): The command that creates the image
  • image_dimensions_x (Image Width): The width of the result image. Must be one of [256, 512, 768, 1024]
  • image_dimensions_y (Image Height): The height of the result image. Must be one of [256, 512, 768, 1024]
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/intern-text-to-image-default/1.0.0?prompt=A%20white%20cat%20attacking%20a%20black%20cat&image_dimensions_x=512&image_dimensions_y=512
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('intern-text-to-image-default','1.0.0', {'prompt': 'A white cat attacking a black cat', 'image_dimensions_x': '512', 'image_dimensions_y': '512'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('intern-text-to-image-default','1.0.0', prompt='A white cat attacking a black cat', image_dimensions_x='512', image_dimensions_y='512')