defaulttrue
typeboolean
{
"NSFW_Detector": true,
"Prompt": "black cat",
"height": 512,
"num_inteference_steps": 20,
"number_picture": 1,
"seed": 1334,
"supabase": false,
"supabase_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lc2JnZnZyaHpsZ2JqaWZvd3FhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5OTgyNTkyMCwiZXhwIjoyMDE1NDAxOTIwfQ.nUaWB1bJdxcz2utI6T-bmsvytPJEaLE0Q7Iv_j_tX0Y",
"supabase_url": "https://mesbgfvrhzlgbjifowqa.supabase.co",
"width": 512
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Oas**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run wglint/2_sdv2-1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"wglint/2_sdv2-1:8afe56ca36701bcd149168704f654ddeb3a24197817893cc0f47c72a48ff35a3",
{
input: {
NSFW_Detector: true,
Prompt: "black cat",
height: 512,
num_inteference_steps: 20,
number_picture: 1,
seed: 1334,
supabase: false,
supabase_key: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lc2JnZnZyaHpsZ2JqaWZvd3FhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5OTgyNTkyMCwiZXhwIjoyMDE1NDAxOTIwfQ.nUaWB1bJdxcz2utI6T-bmsvytPJEaLE0Q7Iv_j_tX0Y",
supabase_url: "https://mesbgfvrhzlgbjifowqa.supabase.co",
width: 512
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Oas**********************************
This is your API token. Keep it to yourself.
import replicate
Run wglint/2_sdv2-1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"wglint/2_sdv2-1:8afe56ca36701bcd149168704f654ddeb3a24197817893cc0f47c72a48ff35a3",
input={
"NSFW_Detector": True,
"Prompt": "black cat",
"height": 512,
"num_inteference_steps": 20,
"number_picture": 1,
"seed": 1334,
"supabase": False,
"supabase_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lc2JnZnZyaHpsZ2JqaWZvd3FhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5OTgyNTkyMCwiZXhwIjoyMDE1NDAxOTIwfQ.nUaWB1bJdxcz2utI6T-bmsvytPJEaLE0Q7Iv_j_tX0Y",
"supabase_url": "https://mesbgfvrhzlgbjifowqa.supabase.co",
"width": 512
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Oas**********************************
This is your API token. Keep it to yourself.
Run wglint/2_sdv2-1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "wglint/2_sdv2-1:8afe56ca36701bcd149168704f654ddeb3a24197817893cc0f47c72a48ff35a3",
"input": {
"NSFW_Detector": true,
"Prompt": "black cat",
"height": 512,
"num_inteference_steps": 20,
"number_picture": 1,
"seed": 1334,
"supabase": false,
"supabase_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lc2JnZnZyaHpsZ2JqaWZvd3FhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5OTgyNTkyMCwiZXhwIjoyMDE1NDAxOTIwfQ.nUaWB1bJdxcz2utI6T-bmsvytPJEaLE0Q7Iv_j_tX0Y",
"supabase_url": "https://mesbgfvrhzlgbjifowqa.supabase.co",
"width": 512
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "dtwpigjbd66wktk3rtlwbh23pq",
"model": "wglint/2_sdv2-1",
"version": "8afe56ca36701bcd149168704f654ddeb3a24197817893cc0f47c72a48ff35a3",
"input": {
"NSFW_Detector": true,
"Prompt": "black cat",
"height": 512,
"num_inteference_steps": 20,
"number_picture": 1,
"seed": 1334,
"supabase": false,
"supabase_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1lc2JnZnZyaHpsZ2JqaWZvd3FhIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY5OTgyNTkyMCwiZXhwIjoyMDE1NDAxOTIwfQ.nUaWB1bJdxcz2utI6T-bmsvytPJEaLE0Q7Iv_j_tX0Y",
"supabase_url": "https://mesbgfvrhzlgbjifowqa.supabase.co",
"width": 512
},
"logs": "NSFW Detector\n 0%| | 0/20 [00:00<?, ?it/s]\n 10%|█ | 2/20 [00:00<00:01, 11.10it/s]\n 20%|██ | 4/20 [00:00<00:01, 11.11it/s]\n 30%|███ | 6/20 [00:00<00:01, 11.11it/s]\n 40%|████ | 8/20 [00:00<00:01, 11.11it/s]\n 50%|█████ | 10/20 [00:00<00:00, 11.11it/s]\n 60%|██████ | 12/20 [00:01<00:00, 11.11it/s]\n 70%|███████ | 14/20 [00:01<00:00, 11.12it/s]\n 80%|████████ | 16/20 [00:01<00:00, 11.12it/s]\n 90%|█████████ | 18/20 [00:01<00:00, 11.12it/s]\n100%|██████████| 20/20 [00:01<00:00, 11.13it/s]\n100%|██████████| 20/20 [00:01<00:00, 11.12it/s]\nStableDiffusionPipelineOutput(images=[<PIL.Image.Image image mode=RGB size=512x512 at 0x7E56E67565D0>], nsfw_content_detected=[False])\nla longueur de la liste est pour image.images 1, et pour image 2\nL'image numéro 0 nest pas NSFW",
"output": [
"https://replicate.delivery/pbxt/oTt25NGNZ9rjIJ2Z0YYLf8dSlqt5KwkEZmZVcnhg9f54iPASA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-08T16:37:59.676483Z",
"started_at": "2023-12-08T16:39:18.079578Z",
"completed_at": "2023-12-08T16:39:20.340165Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/dtwpigjbd66wktk3rtlwbh23pq/cancel",
"get": "https://api.replicate.com/v1/predictions/dtwpigjbd66wktk3rtlwbh23pq"
},
"metrics": {
"predict_time": 2.260587,
"total_time": 80.663682
}
}