Coder Social home page Coder Social logo

unburn / prodia.js Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 9.0 19.41 MB

A simple and up to date wrapper for prodia api with all features included.

TypeScript 100.00%
ai ai-image-generation image-ai ai-image-api prodia text-to-image image-to-image sdxl stable-diffusion stablediffusion

prodia.js's Introduction


A simple and up to date wrapper for prodia api with all features included.

Github โ€ข Support

NPM Version NPM Downloads NPM License GitHub Repo stars


Installation

npm install prodia.js

Usage

For detailed docs about parameters and api key, go to https://prodia.com

Text to Image

import { Prodia } from "prodia.js"

// ----- OR -----

const { Prodia } = require("prodia.js");
const { generateImage, wait } = Prodia("x-x-x-x-x");

const input = async (prompt) => {
    const result = await generateImage({
        prompt: prompt,
        model: "juggernaut_aftermath.safetensors [5e20c455]"
    })

    return await wait(result);
}

input("a photograph of an astronaut riding a horse in the sky").then(console.log)

Tip: play with parameters like negative_prompt, style_preset, steps etc. to get awesome output.

Know more about generation parameters here

Image Example

Transform Image

const { Prodia } = require("prodia.js");
const { transform, wait } = Prodia("x-x-x-x-x");

const input = async (prompt) => {
    const result = await transform({
        imageUrl: "https://images.prodia.xyz/4d81be60-6cf2-417e-a800-eab097295f23.png",
        prompt: prompt,
        model: "juggernaut_aftermath.safetensors [5e20c455]"
    })

    return await wait(result);
}

input("").then(console.log)

Know more about transform parameters here

Transform Example

SDXL Generation

const { Prodia } = require("prodia.js");
const { generateImageSDXL, wait } = Prodia("x-x-x-x-x");

const input = async (prompt) => {
    const result = await generateImageSDXL({
        prompt: prompt,
        model: "sd_xl_base_1.0.safetensors [be9edd61]",
        style_preset: "photographic"
    })

    return await wait(result);
}

input("a giant monster hybrid of dragon and spider, in dark dense foggy forest").then(console.log)

Tip: Use getSDXLModels() to get the list or all SDXL models, same for other.

Know more about sdxl parameters here

SDXL Example

Face Swap

const { Prodia } = require("prodia.js");
const { faceSwap, wait } = Prodia("x-x-x-x-x");

const input = async ({ sourceUrl, targetUrl }) => {
    const result = await faceSwap({
        sourceUrl,
        targetUrl,
    });

    return await wait(result);
}

input({
    sourceUrl: "https://images.prodia.xyz/fe8bd9b3-c3e6-4c7c-bef2-4038fac54dec.png",
    targetUrl: "https://images.prodia.xyz/2a3ea80c-fd56-49a2-be83-180a3fdc5abe.png"
}).then(console.log)

Tip: Here you may get confused about sourceUrl & targetUrl, targetUrl is main face image and sourceUrl is the face image your want to put on targetUrl.

Know more about faceswap parameters here

Face Swap Example

Face Restore

const { Prodia } = require("prodia.js");
const { faceRestore, wait } = Prodia("x-x-x-x-x");

const input = async (imageUrl) => {
    const result = await faceRestore({
        imageUrl
    });

    return await wait(result);
}

input("https://images.prodia.xyz/2913f270-3511-4bec-96f3-4ad0b84c1230.png").then(console.log)

Know more about face restore parameters here

Face Restore Example


There are more features, like Inpainting, ControlNet & Upscale etc.

Support

Our discord community & prodia official server

prodia.js's People

Contributors

flameface avatar montyanderson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

prodia.js's Issues

New Model Support

๐Ÿช„ Dreamshaper 7 - A good model for fantasy portraits
๐Ÿช„ Eimis Anime Diffusion - A strong anime model
๐Ÿช„ MeinaMix Meina V11 - A merged and mixed model of different anime models
๐Ÿช„ Portrait+ V1 - A model trained on a diverse set of close to medium range portraits of people.
๐Ÿช„ Realistic Vision V4.0 - A strong model for realistic portraits
๐Ÿช„ Redshift Diffusion V1.0 - A model trained on high resolution 3D artworks.
๐Ÿช„ Anything V5 - Its back! Everyones favorite Anime model

Modles

How do I see all the modals like
Dreamshaper 7,
Eimis Anime Diffusion, How do i know what to type into model:
for it generate a image in that model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.