Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

BananaMl fork of auto1111 with support for Embeddings

License

Notifications You must be signed in to change notification settings

lucataco/potas-automatic1111-sd-webui

 
 

Repository files navigation

Potassium/Banana Implementation

This repository is the implementation of stable-diffusion-webui with support for Negative Embeddings

Endpoints

At the moment only one endpoint is implemented.

  • /txt2img is the implementation of stable-diffusion-webui /sdapi/v1/txt2img api.

    Json Input

    {
        "body": {
            "params": {
                "prompt": "CAT",
                "negative_prompt": "low quality",
                "steps": 25,
                "sampler_name": "Euler a",
                "cfg_scale": 7.5,
                "seed": 42,
                "batch_size": 1,
                "n_iter": 1,
                "width": 400,
                "height": 400,
                "tiling": 'false',
            }
        }
    }

    OUTPUT:

    {
        "output": "<base64 image>"
    }

Client Implementation in Python

import banana_dev as client

my_model = client.Client(
    api_key="[API_KEY]",
    model_key="[MODEL_KEY]",
    url="[MODEL_URL]",
)

inputs = {
    "params": {
        "prompt": "a girl with long black hair wearing a white shirt and red bow tie, a character portrait, by Muqi, reddit post, sadness look, black hair in braids, dark hallway, red uniform, concerned, visual novel sprite, extremely long forehead, 3 pm, cute scene, wearing tight shirt, female protagonist, red rain, full shot photo",
        "negative_prompt": "EasyNegative, text, close up, cropped, out of frame, worst quality, artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face",
        "steps": 40,
        "sampler_name": "Euler a",
        "cfg_scale": 7.5,
        "seed": 1339,
        "batch_size": 1,
        "n_iter": 1,
        "width": 512,
        "height": 512,
        "tiling": "false",
    }
}

# Call your model's inference endpoint on Banana.
# If you have set up your Potassium app with a
# non-default endpoint, change the first
# method argument ("/")to specify a
# different route.
result, meta = my_model.call("/text2img", inputs)
print(result)

Negative Embeddings

To add Neagtive Embeddings, simply change the EMBEDDING_URL parameter in the Dockerfile to your own URL.

WITHOUT negative embeddings called via negative prompt alt text

WITH negative embeddings called via negative prompt alt text

About

BananaMl fork of auto1111 with support for Embeddings

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 87.8%
  • Dockerfile 12.2%