1.0.0 • Published 4 months ago

@fazza/gpti v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

GPTI

This package simplifies your interaction with various GPT models, eliminating the need for tokens or other methods to access GPT. It also allows you to use three artificial intelligences to generate images: DALL·E, Prodia, and Lexica, all of this without restrictions or limits

Installation

You can install the package via NPM

npm i gpti

CDN Links

If you'd rather not install the package via NPM, you can also include it directly from a Content Delivery Network (CDN).

Once you've included the script, you can use the package like this:

const { gpt, dalle, lexica, prodia } = gpti;

UNPKG:

To include the package from UNPKG, add the following script tag to your HTML file:

<script src="https://unpkg.com/gpti@1.0.5/gpti.js"></script>

jsDelivr:

To include the package from jsDelivr, add the following script tag to your HTML file:

<script src="https://cdn.jsdelivr.net/npm/gpti@1.0.5/gpti.js"></script>

esm.sh

For esm.sh, include the following script tag in your HTML file:

<script src="https://esm.sh/gpti@1.0.5/gpti.js"></script>

Skypack:

If you prefer using ES6 modules, you can import the package from Skypack as follows:

<script type="module">
    import { gpt, dalle, lexica, prodia } from 'https://cdn.skypack.dev/gpti@1.0.5';

    // Now you can use the 'gpti' package in your JavaScript code
</script>

These CDN options allow you to include the package in your web project with ease. Simply choose the one that fits your project's requirements.

Usage GPT

// import { gpt } from "gpti";
const { gpt } = require("gpti");

gpt({
    prompt: "hello gpt, tell me what your version is?",
    model: "gpt-4",                         // code or model
    type: "json"                            // optional: "json" or "markdown"
}, (err, data) => {
    if(err != null){
        console.log(err);
    } else {
        console.log(data);
    }
});

JSON

{
    "api": "gpti",
    "code": 200,
    "status": true,
    "model": {
        "code": 1,
        "type": "gpt-4"
    },
    "gpt": "Hello there! I'm GPT-4, the fourth version of the Generative Pre-trained Transformer (GPT) model. As an AI language model, I'm designed to generate human-like text based on the given inputs and previous context. I'm constantly trained on vast amounts of text data from the internet, books, and other sources to improve my understanding and generate more accurate responses. How can I assist you today?"
}

Models

CodeModel
1gpt-4
2gpt-4-0613
3gpt-4-32k
4gpt-4-0314
5gpt-4-32k-0314
6gpt-3.5-turbo
7gpt-3.5-turbo-16k
8gpt-3.5-turbo-0613
9gpt-3.5-turbo-16k-0613
10gpt-3.5-turbo-0301
11text-davinci-003
12text-davinci-002
13code-davinci-002
14gpt-3
15text-curie-001
16text-babbage-001
17text-ada-001
18davinci
19curie
20babbage
21ada
22babbage-002
23davinci-002

Usage DALL·E

// import { dalle } from "gpti";
const { dalle } = require("gpti");

dalle({
    prompt: "starry sky over the city",
    type: "json"                            // optional
}, (err, data) => {
    if(err != null){
        console.log(err);
    } else {
        console.log(data);
    }
});

JSON

{
    "api": "dalleai",
    "code": 200,
    "status": true,
    "prompt": "starry sky over the city",
    "ul": "https://..."
}

Usage Lexica

// import { lexica } from "gpti";
const { lexica } = require("gpti");

lexica({
    prompt: "the sky is dyed with soft tones as the sun bids farewell",
    type: "json"                            // optional
}, (err, data) => {
    if(err != null){
        console.log(err);
    } else {
        console.log(data);
    }
});

JSON

{
    "api": "lexicaai",
    "code": 200,
    "status": true,
    "prompt": "the sky is dyed with soft tones as the sun bids farewell",
    "images": [
        {
            "ul": "https://..."
        },
        {
            "ul": "https://..."
        },
        ...
    ]
}

Usage Prodia

// import { prodia } from "gpti";
const { prodia } = require("gpti");

prodia({
    prompt: "the sun bids farewell in a warm sky, painting soft colors as the clouds dance",
    model: "Realistic_Vision_V5.0.safetensors [614d1063]",                          // code or model
    sampler: "Euler",                                                               // code or sampler
    steps: 25,                                                                      // 1-30
    cfg_scale: 7,                                                                   // 0-20
    negative_prompt: "",                                                            // optional
    type: "json"                                                                    // optional
}, (err, data) => {
    if(err != null){
        console.log(err);
    } else {
        console.log(data);
    }
});

JSON

{
    "api": "prodiaai",
    "code": 200,
    "status": true,
    "model": {
        "model": {
            "code": 25,
            "type": "Realistic_Vision_V5.0.safetensors [614d1063]",
            "name": "Realistic Vision V5.0"
        },
        "sampler": {
            "code": 1,
            "type": "Euler",
        }
        "steps": 25,
        "cfg_scale": 7,
        "prompt": "the sun bids farewell in a warm sky, painting soft colors as the clouds dance",
        "negative_prompt": ""
    },
    "ul": "https://..."
}

Models

CodeModelName
1absolutereality_V16.safetensors 37db0fc3Absolute Reality V1.6
2absolutereality_v181.safetensors 3d9d4d2bAbsolute Reality V1.8.1
3analog-diffusion-1.0.ckpt 9ca13f02Analog V1
4anythingv3_0-pruned.ckpt 2700c435Anything V3
5anything-v4.5-pruned.ckpt 65745d25Anything V4.5
6anythingV5_PrtRE.safetensors 893e49b9Anything V5
7AOM3A3_orangemixs.safetensors 9600da17AbyssOrangeMix V3
8deliberate_v2.safetensors 10ec4b29Deliberate V2
9dreamlike-diffusion-1.0.safetensors 5c9fd6e0Dreamlike Diffusion V1
10dreamlike-photoreal-2.0.safetensors fdcf65e7Dreamlike Photoreal V2
11dreamshaper_6BakedVae.safetensors 114c8abbDreamshaper 6 baked vae
12dreamshaper_7.safetensors 5cf5ae06Dreamshaper 7
13dreamshaper_8.safetensors 9d40847dDreamshaper 8
14EimisAnimeDiffusion_V1.ckpt 4f828a15Eimis Anime Diffusion V1.0
15elldreths-vivid-mix.safetensors 342d9d26Elldreth's Vivid
16lyriel_v16.safetensors 68fceea2Lyriel V1.6
17mechamix_v10.safetensors ee685731MechaMix V1.0
18meinamix_meinaV9.safetensors 2ec66ab0MeinaMix Meina V9
19meinamix_meinaV11.safetensors b56ce717MeinaMix Meina V11
20openjourney_V4.ckpt ca2f377fOpenjourney V4
21portraitplus_V1.0.safetensors 1400e684Portrait+ V1
22Realistic_Vision_V1.4-pruned-fp16.safetensors 8d21810bRealistic Vision V1.4
23Realistic_Vision_V2.0.safetensors 79587710Realistic Vision V2.0
24Realistic_Vision_V4.0.safetensors 29a7afaaRealistic Vision V4.0
25Realistic_Vision_V5.0.safetensors 614d1063Realistic Vision V5.0
26redshift_diffusion-V10.safetensors 1400e684Redshift Diffusion V1.0
27revAnimated_v122.safetensors 3f4fefd9ReV Animated V1.2.2
28sdv1_4.ckpt 7460a6faSD V1.4
29v1-5-pruned-emaonly.safetensors d7049739SD V1.5
30shoninsBeautiful_v10.safetensors 25d8c546Shonin's Beautiful People V1.0
31theallys-mix-ii-churned.safetensors 5d9225a4TheAlly's Mix II
32timeless-1.0.ckpt 7c4971d4Timeless V1

Samplers

CodeSampler
1Euler
2Euler a
3Heun
4DPM++ 2M Karras
5DPM++ SDE Karras
6DDIM

API Reference

Currently, the API has no access restrictions or usage limits.

For more details and examples, refer to the complete documentation

Success

The API can return the following success response code:

  • 200 OK: The request was successful, and the response data is provided.

Errors

The API can return the following error codes:

  • 400 Bad Request: Incorrect or insufficient parameters.
  • 404 Not Found: The requested resource was not found.