typetext
{
"guidance_scale": 7.5,
"height": 512,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "Mossy Runic Bricks seamless texture, trending on artstation, stone, moss, base color, albedo, 4k",
"prompt_strength": 0.8,
"width": 512
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_GgI**********************************
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 tommoore515/material_stable_diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tommoore515/material_stable_diffusion:56f26876a159c10b429c382f66ccda648c1d5678d7ce15ed010734b715be5ab9",
{
input: {
guidance_scale: 7.5,
height: 512,
num_inference_steps: 50,
num_outputs: 1,
prompt: "Mossy Runic Bricks seamless texture, trending on artstation, stone, moss, base color, albedo, 4k",
prompt_strength: 0.8,
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_GgI**********************************
This is your API token. Keep it to yourself.
import replicate
Run tommoore515/material_stable_diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tommoore515/material_stable_diffusion:56f26876a159c10b429c382f66ccda648c1d5678d7ce15ed010734b715be5ab9",
input={
"guidance_scale": 7.5,
"height": 512,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "Mossy Runic Bricks seamless texture, trending on artstation, stone, moss, base color, albedo, 4k",
"prompt_strength": 0.8,
"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_GgI**********************************
This is your API token. Keep it to yourself.
Run tommoore515/material_stable_diffusion 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": "tommoore515/material_stable_diffusion:56f26876a159c10b429c382f66ccda648c1d5678d7ce15ed010734b715be5ab9",
"input": {
"guidance_scale": 7.5,
"height": 512,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "Mossy Runic Bricks seamless texture, trending on artstation, stone, moss, base color, albedo, 4k",
"prompt_strength": 0.8,
"width": 512
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "6o5jjvornrcwtadmvv7qkty2z4",
"model": "tommoore515/material_stable_diffusion",
"version": "56f26876a159c10b429c382f66ccda648c1d5678d7ce15ed010734b715be5ab9",
"input": {
"guidance_scale": 7.5,
"height": 512,
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "Mossy Runic Bricks seamless texture, trending on artstation, stone, moss, base color, albedo, 4k",
"prompt_strength": 0.8,
"width": 512
},
"logs": "Using seed: 46183\n\n0it [00:00, ?it/s]\n1it [00:00, 5.73it/s]\n2it [00:00, 4.17it/s]\n3it [00:00, 3.93it/s]\n4it [00:01, 3.83it/s]\n5it [00:01, 3.77it/s]\n6it [00:01, 3.73it/s]\n7it [00:01, 3.70it/s]\n8it [00:02, 3.71it/s]\n9it [00:02, 3.68it/s]\n10it [00:02, 3.68it/s]\n11it [00:02, 3.67it/s]\n12it [00:03, 3.68it/s]\n13it [00:03, 3.66it/s]\n14it [00:03, 3.66it/s]\n15it [00:04, 3.65it/s]\n16it [00:04, 3.65it/s]\n17it [00:04, 3.65it/s]\n18it [00:04, 3.65it/s]\n19it [00:05, 3.65it/s]\n20it [00:05, 3.63it/s]\n21it [00:05, 3.64it/s]\n22it [00:05, 3.63it/s]\n23it [00:06, 3.64it/s]\n24it [00:06, 3.64it/s]\n25it [00:06, 3.65it/s]\n26it [00:07, 3.64it/s]\n27it [00:07, 3.63it/s]\n28it [00:07, 3.63it/s]\n29it [00:07, 3.63it/s]\n30it [00:08, 3.63it/s]\n31it [00:08, 3.63it/s]\n32it [00:08, 3.62it/s]\n33it [00:08, 3.62it/s]\n34it [00:09, 3.62it/s]\n35it [00:09, 3.62it/s]\n36it [00:09, 3.62it/s]\n37it [00:10, 3.61it/s]\n38it [00:10, 3.61it/s]\n39it [00:10, 3.62it/s]\n40it [00:10, 3.62it/s]\n41it [00:11, 3.61it/s]\n42it [00:11, 3.61it/s]\n43it [00:11, 3.61it/s]\n44it [00:12, 3.61it/s]\n45it [00:12, 3.61it/s]\n46it [00:12, 3.62it/s]\n47it [00:12, 3.62it/s]\n48it [00:13, 3.62it/s]\n49it [00:13, 3.61it/s]\n50it [00:13, 3.61it/s]\n50it [00:13, 3.66it/s]",
"output": [
"https://replicate.delivery/mgxm/a5f7f356-99b4-4b7c-85b9-b084960f7552/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-09-07T01:13:59.677073Z",
"started_at": "2022-09-07T01:13:59.869154Z",
"completed_at": "2022-09-07T01:14:14.906612Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/6o5jjvornrcwtadmvv7qkty2z4/cancel",
"get": "https://api.replicate.com/v1/predictions/6o5jjvornrcwtadmvv7qkty2z4"
},
"metrics": {
"predict_time": 15.037458,
"total_time": 15.229539
}
}