Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
[![npm version](https://img.shields.io/npm/v/deepai.svg?style=flat-square)](https://www.npmjs.org/package/deepai) [![CodeQL](https://github.com/deepai-org/deepai-js-client/actions/workflows/codeql.yml/badge.svg)](https://github.com/deepai-org/deepai-js-cl
The official Javascript Client Library for accessing Deep AI's advanced machine learning models. Designed for both browser and Node.js environments.
npm install --save deepai
<script src="https://cdnjs.deepai.org/deepai.min.js"></script>
Most examples are for NSFW Detector (nsfw-detector), but you can substitute any model name from the DeepAI model list.
Ensure that you pass the correct input names. They vary based on the model. Refer to each model's documentation on DeepAI.org for specifics.
All examples use Async-Await syntax, so ensure you run the code in an async function.
Initialize and set your API key:
deepai.setApiKey("YOUR_API_KEY"); // Obtain your API key from https://deepai.org
Pass URL: Using the Super Resolution model:
var result = await deepai.callStandardApi("torch-srgan", {
image: "https://YOUR_IMAGE_URL",
});
Pass Literal Text: For the Text Generation model:
var result = await deepai.callStandardApi("text-generator", {
text: "Your long article or text goes here.",
});
Pass Image DOM Element: Using the NSFW Detector model:
var result = await deepai.callStandardApi("nsfw-detector", {
image: document.getElementById("yourImageId"),
});
Pass File Picker Element: Using the Waifu 2x model:
var result = await deepai.callStandardApi("waifu2x", {
image: document.getElementById("yourFilePickerId"),
});
Initialize and set your API key:
const deepai = require("deepai");
deepai.setApiKey("YOUR_API_KEY"); // Obtain your API key from https://deepai.org
Pass URL: Using the NSFW Detector model:
var result = await deepai.callStandardApi("nsfw-detector", {
image: "https://YOUR_IMAGE_URL",
});
Pass Literal Text: For the Text Generation model:
var result = await deepai.callStandardApi("text-generator", {
text: "Your long article or text goes here.",
});
Pass File Upload: Using the NSFW Detector model:
const fs = require('fs');
// ...
var result = await deepai.callStandardApi("nsfw-detector", {
image: fs.createReadStream('/path/to/your/file.jpg')
});
For all "Text to Image" models, the following options are available:
text
:(Required) A string, URL, or binary text file that serves as the main prompt for the image generation.
negative_prompt
:(Optional) A string to indicate elements you'd like to be removed from or avoided in the image.
Can be used to enhance image quality and details.
Example negative prompts:
bad anatomy, bad proportions, blurry, cloned face, cropped, deformed, dehydrated, disfigured, duplicate, error, extra arms, extra fingers, extra legs, extra limbs, fused fingers, gross proportions, jpeg artifacts, long neck, low quality, lowres, malformed limbs, missing arms, missing legs, morbid, mutated hands, mutation, mutilated, out of frame, poorly drawn face, poorly drawn hands, signature, text, too many fingers, ugly, username, watermark, worst quality.
grid_size
:(Optional) Pass a string, either "1" or "2".
“2” is the default, which returns a 2x2 grid with 4 images. Pass “1” to only receive 1 image.
width
, height
:(Optional) Pass a string, e.g., "256" or "768". Default is "512". Acceptable values range between 128 and 1536. Note: values above approximately 700 or below 256 may produce strange outputs.
Example:
{
"text": "A serene beach at sunset",
"negative_prompt": "No people",
"grid_size": "4x4",
"width": "1024",
"height": "768"
}
Adjust these options to customize the output according to your requirements.
text-generator
)nsfw-detector
)image-similarity
)text2img
)stable-diffusion
)cute-creature-generator
)fantasy-world-generator
)cyberpunk-generator
)anime-portrait-generator
)old-style-generator
)renaissance-painting-generator
)abstract-painting-generator
)impressionism-painting-generator
)surreal-graphics-generator
)3d-objects-generator
)origami-3d-generator
)hologram-3d-generator
)3d-character-generator
)watercolor-painting-generator
)pop-art-generator
)contemporary-architecture-generator
)future-architecture-generator
)watercolor-architecture-generator
)fantasy-character-generator
)steampunk-generator
)logo-generator
)pixel-art-generator
)street-art-generator
)surreal-portrait-generator
)anime-world-generator
)fantasy-portrait-generator
)comics-portrait-generator
)cyberpunk-portrait-generator
)torch-srgan
)waifu2x
)colorizer
)For contributors and maintainers of the library:
npm install
npm run-script build
npm login
npm publish
The browser-based build uses the webpack-generated code in dist/. The Node.js environment utilizes the code in the lib folder, which can also function in the browser, for instance, in a React webpack application.
For more detailed documentation, model explanations, and FAQs, visit DeepAI.org.
FAQs
[![npm version](https://img.shields.io/npm/v/deepai.svg?style=flat-square)](https://www.npmjs.org/package/deepai) [![CodeQL](https://github.com/deepai-org/deepai-js-client/actions/workflows/codeql.yml/badge.svg)](https://github.com/deepai-org/deepai-js-cl
The npm package deepai receives a total of 3,472 weekly downloads. As such, deepai popularity was classified as popular.
We found that deepai demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.