Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
[![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 2,331 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.