Git Product home page Git Product logo

ai2d's Introduction

OWNER AI2D


izin update code aruga, soalnya package lu yang maren dah gabisa dipake (update upload URL)

npm version install size npm downloads

Generate a hyper-realistic photo an anime style!

Table of Contents

Features

  • Generate a hyper-realistic photo an anime style

Install

$ npm install --save @arugaz/ai2d
$ yarn add @arugaz/ai2d

Before use this package, You have to add sharp or jimp to dependencies.

Usage

import AI2D from "@arugaz/ai2d";

await AI2D(`Buffer | Base64 | Url | Path`, options);

// default
await AI2D("https://nekopoi.care/image.png"); //=> Buffer

// crop
await AI2D("https://nekopoi.care/image.png", {
  crop: "SINGLE", // SINGLE | COMPARED
}); //=> Buffer

// proxy
await AI2D("https://nekopoi.care/image.png", {
  proxy: {
    url: "http://101.32.184.53:3128",
    chinese: true,
    image: false,
  }, // support http & socks
}); //=> Buffer

// with async-retry opts
await AI2D("https://nekopoi.care/image.png", {
  crop: "COMPARED",
  retries: 100,
  factor: 3,
  randomize: false,
}); //=> Buffer

Options

The options are

  • crop: COMPARED | SINGLE. Default didnt crop the image.
  • proxy: Support http?s or socks proxy
    • url: Your proxy url.
    • chinese: Boolean, is your proxy from chinese?
    • image: Boolean, download the image with proxy?
  • retries: The maximum amount of times to retry the operation. Default is 10.
  • factor: The exponential factor to use. Default is 1.
  • minTimeout: The number of milliseconds before starting the first retry. Default is 1000.
  • maxTimeout: The maximum number of milliseconds between two retries. Default is Infinity.
  • randomize: Randomizes the timeouts by multiplying with a factor between 1 to 2. Default is true.
  • onRetry: an optional Function that is invoked after a new retry is performed. It's passed the Error that triggered it as a parameter.
  • forever: Whether to retry forever.
  • unref: Whether to unref the setTimeout's.

Tldr

From December 6 to December 15 the AI had been available only in China or with Chinese proxies. Since December 16 the AI works for the rest of the world (UPD: still doesn't work in some countries) again so using proxies is not needed anymore, but it's limited and allows you to generate only one type of media. Seems like it's impossible to find FREE alive proxies. Don't waste your time searching and just buy it somewhere.

License

MIT

ai2d's People

Contributors

dutakey avatar

Watchers

 avatar

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.