Skip to content

ftk789/FakeYouAPI.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord NPM GITHUB

fakeyouapi.js is a powerful Node.js module that allows you to interact with the FakeYouAPI easily. (An updated version of FakeYou.js )

Features

Examples

Login or use your token

const FakeYou = require("fakeyou.js");
const fy = new FakeYou.Client({
  token: "anOptionalSecretToken",
  usernameOrEmail: "anOptionalCoolUsernameOrEmail",
  password: "anOptionalSuperSecretPassword",
});
await fy.start(); //required

Search TTS models

let models = fy.searchModel("mario");
models.first();

Make TTS Request

await fy.makeTTS("mario", "A cool text to speech");
//or
let model = fy.searchModel("mario").first();
if (model) {
  await model.request("A cool text to speech");
}

Make TTI Request

// You can search for weights by using the method below:
let weights = await fy.getTTIModels();
// This will return an array of all the available models, You log it and pick one like how you pick from an array.

// the format of the array is like this:
/*
[
  ...
  {
    title: Weight_Title, weight_token: Weight_Token
  }
  ...
]
*/

let response = await fy.makeTTI(weights[8], "A cool text to image prompt", LoraModel, NegativeText, seed, imageShape, sampler, CGF_Scale, SamplesNumber, BatchCount);

/* 

The current variables are optional and not:



LoraModel (string), NegativeText (string), seed (integer), imageShape (string), sampler (string), CGF_Scale (integer), SamplesNumber (integer), BatchCount (integer) .

You can obtain those values and inputs from FakeYou's website.

Inserting a wrong format of a integer value or a text, Will result in an error.

*/

//or

let response = await fy.makeTTI(weights[4], "A cool text to image prompt");


/*

An example of a response:

[
  'https://storage.googleapis.com/vocodes-public/media/0/3/4/2/m/0342m88c1vqjt24zd5qpat5gns270bdr/image_0342m88c1vqjt24zd5qpat5gns270bdr.png',
  'https://storage.googleapis.com/vocodes-public/media/y/9/t/k/j/y9tkj5nt40q3cqgaseje1h0zg46agwf8/image_y9tkj5nt40q3cqgaseje1h0zg46agwf8.png',
  'https://storage.googleapis.com/vocodes-public/media/h/c/s/1/d/hcs1d36papj6gknxdb8s80g4z35ndwdg/image_hcs1d36papj6gknxdb8s80g4z35ndwdg.png',
  'https://storage.googleapis.com/vocodes-public/media/f/d/j/y/k/fdjykhmrnyqj3jjjyxy4trp6dvde6qfy/image_fdjykhmrnyqj3jjjyxy4trp6dvde6qfy.png'
]

*/

LeaderBoard

let lb = await fy.leaderboard();
lb.getPosition(3, true);

Edit client user

await fy.user.edit({
  description: "Another **random** user in FakeYou",
  twitter: null,
  github: "a-cool-username",
  ttsVisibility: false,
});

Get all data from an entity

await fy.models.fetch("TM:7wbtjphx8h8v");
//or
await fy.fetchUser("acoolusername");
//or
let result = fy.results.cache.get("TR:tn7gq96wg6httvnq91y4y9fka76nj");
if (result) {
  await result.fetch();
}

Useful links

About

An updated version of FakeYou.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published