typetext
{
"detail_level": "high",
"guidance": 6,
"guidance_scale": 5.5,
"num_inference_steps": 50,
"octree_resolution": 512,
"prompt": "A wizard in a purple robe and pointed hat, wielding a staff and casting a spell.",
"prompt_strength": 0.8,
"remove_background": true,
"seed": 1234,
"steps": 50
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_CJs**********************************
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 gfodor/text2vox using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"gfodor/text2vox:740dd98e409d65e7a0fa02ec9bf549bd903b19a18a0cab02865d4615225c8ba5",
{
input: {
detail_level: "high",
guidance: 6,
guidance_scale: 5.5,
num_inference_steps: 50,
octree_resolution: 512,
prompt: "A wizard in a purple robe and pointed hat, wielding a staff and casting a spell.",
prompt_strength: 0.8,
remove_background: true,
seed: 1234,
steps: 50
}
}
);
// 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_CJs**********************************
This is your API token. Keep it to yourself.
import replicate
Run gfodor/text2vox using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"gfodor/text2vox:740dd98e409d65e7a0fa02ec9bf549bd903b19a18a0cab02865d4615225c8ba5",
input={
"detail_level": "high",
"guidance": 6,
"guidance_scale": 5.5,
"num_inference_steps": 50,
"octree_resolution": 512,
"prompt": "A wizard in a purple robe and pointed hat, wielding a staff and casting a spell.",
"prompt_strength": 0.8,
"remove_background": True,
"seed": 1234,
"steps": 50
}
)
# 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_CJs**********************************
This is your API token. Keep it to yourself.
Run gfodor/text2vox 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": "gfodor/text2vox:740dd98e409d65e7a0fa02ec9bf549bd903b19a18a0cab02865d4615225c8ba5",
"input": {
"detail_level": "high",
"guidance": 6,
"guidance_scale": 5.5,
"num_inference_steps": 50,
"octree_resolution": 512,
"prompt": "A wizard in a purple robe and pointed hat, wielding a staff and casting a spell.",
"prompt_strength": 0.8,
"remove_background": true,
"seed": 1234,
"steps": 50
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Use your mouse to zoom and rotate the model
{
"id": "f86cxbqt61rj00cnrw1bxhg2gw",
"model": "gfodor/text2vox",
"version": "740dd98e409d65e7a0fa02ec9bf549bd903b19a18a0cab02865d4615225c8ba5",
"input": {
"detail_level": "high",
"guidance": 6,
"guidance_scale": 5.5,
"num_inference_steps": 50,
"octree_resolution": 512,
"prompt": "A wizard in a purple robe and pointed hat, wielding a staff and casting a spell.",
"prompt_strength": 0.8,
"remove_background": true,
"seed": 1234,
"steps": 50
},
"logs": "Using seed: 1234\n0it [00:00, ?it/s]\n1it [00:00, 3.51it/s]\n2it [00:00, 2.62it/s]\n3it [00:01, 2.42it/s]\n4it [00:01, 2.34it/s]\n5it [00:02, 2.29it/s]\n6it [00:02, 2.27it/s]\n7it [00:02, 2.25it/s]\n8it [00:03, 2.24it/s]\n9it [00:03, 2.23it/s]\n10it [00:04, 2.23it/s]\n11it [00:04, 2.22it/s]\n12it [00:05, 2.22it/s]\n13it [00:05, 2.21it/s]\n14it [00:06, 2.21it/s]\n15it [00:06, 2.21it/s]\n16it [00:07, 2.21it/s]\n17it [00:07, 2.21it/s]\n18it [00:07, 2.21it/s]\n19it [00:08, 2.21it/s]\n20it [00:08, 2.21it/s]\n21it [00:09, 2.21it/s]\n22it [00:09, 2.21it/s]\n23it [00:10, 2.21it/s]\n24it [00:10, 2.21it/s]\n25it [00:11, 2.21it/s]\n26it [00:11, 2.21it/s]\n27it [00:12, 2.21it/s]\n28it [00:12, 2.20it/s]\n29it [00:12, 2.21it/s]\n30it [00:13, 2.21it/s]\n31it [00:13, 2.20it/s]\n32it [00:14, 2.21it/s]\n33it [00:14, 2.20it/s]\n34it [00:15, 2.21it/s]\n35it [00:15, 2.20it/s]\n36it [00:16, 2.21it/s]\n37it [00:16, 2.20it/s]\n38it [00:17, 2.20it/s]\n39it [00:17, 2.21it/s]\n40it [00:17, 2.21it/s]\n41it [00:18, 2.20it/s]\n42it [00:18, 2.20it/s]\n43it [00:19, 2.20it/s]\n44it [00:19, 2.20it/s]\n45it [00:20, 2.20it/s]\n46it [00:20, 2.20it/s]\n47it [00:21, 2.20it/s]\n48it [00:21, 2.20it/s]\n49it [00:22, 2.20it/s]\n50it [00:22, 2.20it/s]\n50it [00:22, 2.22it/s]\nTotal safe images: 1 out of 1\nDiffusion Sampling:: 0%| | 0/50 [00:00<?, ?it/s]\nDiffusion Sampling:: 4%|▍ | 2/50 [00:00<00:03, 14.64it/s]\nDiffusion Sampling:: 8%|▊ | 4/50 [00:00<00:03, 12.88it/s]\nDiffusion Sampling:: 12%|█▏ | 6/50 [00:00<00:03, 12.38it/s]\nDiffusion Sampling:: 16%|█▌ | 8/50 [00:00<00:03, 12.14it/s]\nDiffusion Sampling:: 20%|██ | 10/50 [00:00<00:03, 11.93it/s]\nDiffusion Sampling:: 24%|██▍ | 12/50 [00:00<00:03, 11.99it/s]\nDiffusion Sampling:: 28%|██▊ | 14/50 [00:01<00:03, 11.93it/s]\nDiffusion Sampling:: 32%|███▏ | 16/50 [00:01<00:02, 11.87it/s]\nDiffusion Sampling:: 36%|███▌ | 18/50 [00:01<00:02, 11.85it/s]\nDiffusion Sampling:: 40%|████ | 20/50 [00:01<00:02, 11.83it/s]\nDiffusion Sampling:: 44%|████▍ | 22/50 [00:01<00:02, 11.80it/s]\nDiffusion Sampling:: 48%|████▊ | 24/50 [00:02<00:02, 11.79it/s]\nDiffusion Sampling:: 52%|█████▏ | 26/50 [00:02<00:02, 11.77it/s]\nDiffusion Sampling:: 56%|█████▌ | 28/50 [00:02<00:01, 11.79it/s]\nDiffusion Sampling:: 60%|██████ | 30/50 [00:02<00:01, 11.82it/s]\nDiffusion Sampling:: 64%|██████▍ | 32/50 [00:02<00:01, 11.79it/s]\nDiffusion Sampling:: 68%|██████▊ | 34/50 [00:02<00:01, 11.80it/s]\nDiffusion Sampling:: 72%|███████▏ | 36/50 [00:03<00:01, 11.79it/s]\nDiffusion Sampling:: 76%|███████▌ | 38/50 [00:03<00:01, 11.80it/s]\nDiffusion Sampling:: 80%|████████ | 40/50 [00:03<00:00, 11.80it/s]\nDiffusion Sampling:: 84%|████████▍ | 42/50 [00:03<00:00, 11.81it/s]\nDiffusion Sampling:: 88%|████████▊ | 44/50 [00:03<00:00, 11.81it/s]\nDiffusion Sampling:: 92%|█████████▏| 46/50 [00:03<00:00, 11.79it/s]\nDiffusion Sampling:: 96%|█████████▌| 48/50 [00:04<00:00, 11.81it/s]\nDiffusion Sampling:: 100%|██████████| 50/50 [00:04<00:00, 11.81it/s]\nDiffusion Sampling:: 100%|██████████| 50/50 [00:04<00:00, 11.89it/s]\n2025-03-24 07:17:43,790 - hy3dgen.shapgen - INFO - FlashVDMVolumeDecoding Resolution: [63, 126, 252, 504]\nFlashVDM Volume Decoding: 0%| | 0/2 [00:00<?, ?it/s]\nFlashVDM Volume Decoding: 100%|██████████| 2/2 [00:00<00:00, 63.39it/s]\nExtracting textures from mesh.glb...\nparam = textures\nLaunching asset import ... OK\nValidating postprocessing flags ... OK\n0 %\n50 %\nImporting file ... OK\nimport took approx. 0.01072 seconds\nassimp extract: Exporting 1 textures\nassimp extract: Texture 0 is compressed (png). Writing native file format.\nassimp extract: Wrote texture 0 to textures_img0.png\nExporting to OBJ format...\nparam = mesh_with_textures.obj\nparam = -ptv\nassimp export: select file format: 'obj' (Wavefront OBJ format)\nLaunching asset import ... OK\nValidating postprocessing flags ... OK\n0 %\n50 %\n50 %\n51.5152 %\n53.0303 %\n54.5455 %\n56.0606 %\n57.5758 %\n59.0909 %\n60.6061 %\n62.1212 %\n63.6364 %\n65.1515 %\n66.6667 %\n68.1818 %\n69.697 %\n71.2121 %\n72.7273 %\n74.2424 %\n75.7576 %\n77.2727 %\n78.7879 %\n80.303 %\n81.8182 %\n83.3333 %\n84.8485 %\n86.3636 %\n87.8788 %\n89.3939 %\n90.9091 %\n92.4242 %\n93.9394 %\n95.4546 %\n96.9697 %\n98.4848 %\n100 %\nImporting file ... OK\nimport took approx. 0.01152 seconds\nLaunching asset export ... OK\nExporting file ... OK\nexport took approx. 0.15870 seconds\nassimp export: wrote output file: mesh_with_textures.obj\nFixing texture references in MTL file...\nsed: can't read : No such file or directory\nConverting to VOX format with resolution 96...\nwine: created the configuration directory '/root/.wine'\n0048:err:explorer:initialize_display_settings Failed to query current display settings for L\"\\\\\\\\.\\\\DISPLAY1\".\n0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002\n0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002\n0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002\n002c:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.\n002c:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.\n0050:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.\n0050:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.\n0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0\n0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0\n0050:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007\n0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x800736b7\n0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x800736b7\n0050:err:ole:apartment_get_local_server_stream Failed: 0x800736b7\n0050:err:ole:start_rpcss Failed to open RpcSs service\n0040:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.\n0040:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.\n0040:err:setupapi:SetupDefaultQueueCallbackW copy error 1812 L\"@wineusb.sys,-1\" -> L\"C:\\\\windows\\\\inf\\\\wineusb.inf\"\nCould not find Wine Gecko. HTML rendering will be disabled.\n0098:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.\n0098:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.\nCould not find Wine Gecko. HTML rendering will be disabled.\nwine: configuration in L\"/root/.wine\" has been updated.\nReading mesh_with_textures.obj\nReading mesh_with_textures.mtl.... found\nmesh_with_textures.mtl NOT FOUND or not supported format\ntextures_img0.png loaded successfully\nScale factor used (voxel/polygon units):48.865746\nx:0..69, y:0..53, z:0..96\nWriting tmp.vox (70x54x97)\n0.26 seconds\nDone.\nConverting to MagicaVoxel format...\nGenerating SVOX and GLTF...\nAssertion failed: RGBA length mismatch 65456:65452\nConverting GLTF to GLB...\nTotal: 58.206ms\nConversion complete: output/mesh_large.vox, output/mesh_large.vox.gltf, and output/mesh_large.vox.glb\nCleaning up intermediate files...\nExtracting textures from mesh.glb...\nparam = textures\nLaunching asset import ... OK\nValidating postprocessing flags ... OK\n0 %\n50 %\nImporting file ... OK\nimport took approx. 0.00699 seconds\nassimp extract: Exporting 1 textures\nassimp extract: Texture 0 is compressed (png). Writing native file format.\nassimp extract: Wrote texture 0 to textures_img0.png\nExporting to OBJ format...\nparam = mesh_with_textures.obj\nparam = -ptv\nassimp export: select file format: 'obj' (Wavefront OBJ format)\nLaunching asset import ... OK\nValidating postprocessing flags ... OK\n0 %\n50 %\n50 %\n51.5152 %\n53.0303 %\n54.5455 %\n56.0606 %\n57.5758 %\n59.0909 %\n60.6061 %\n62.1212 %\n63.6364 %\n65.1515 %\n66.6667 %\n68.1818 %\n69.697 %\n71.2121 %\n72.7273 %\n74.2424 %\n75.7576 %\n77.2727 %\n78.7879 %\n80.303 %\n81.8182 %\n83.3333 %\n84.8485 %\n86.3636 %\n87.8788 %\n89.3939 %\n90.9091 %\n92.4242 %\n93.9394 %\n95.4546 %\n96.9697 %\n98.4848 %\n100 %\nImporting file ... OK\nimport took approx. 0.00774 seconds\nLaunching asset export ... OK\nExporting file ... OK\nexport took approx. 0.14839 seconds\nassimp export: wrote output file: mesh_with_textures.obj\nFixing texture references in MTL file...\nsed: can't read : No such file or directory\nConverting to VOX format with resolution 80...\n0050:err:explorer:initialize_display_settings Failed to query current display settings for L\"\\\\\\\\.\\\\DISPLAY1\".\nReading mesh_with_textures.obj\nReading mesh_with_textures.mtl.... found\nmesh_with_textures.mtl NOT FOUND or not supported format\ntextures_img0.png loaded successfully\nScale factor used (voxel/polygon units):40.712963\nx:0..57, y:0..44, z:0..80\nWriting tmp.vox (58x45x81)\n0.27 seconds\nDone.\nConverting to MagicaVoxel format...\nSkipping SVOX, GLTF, and GLB generation as requested\nConversion complete: output/mesh_medium.vox\nCleaning up intermediate files...\nExtracting textures from mesh.glb...\nparam = textures\nLaunching asset import ... OK\nValidating postprocessing flags ... OK\n0 %\n50 %\nImporting file ... OK\nimport took approx. 0.00719 seconds\nassimp extract: Exporting 1 textures\nassimp extract: Texture 0 is compressed (png). Writing native file format.\nassimp extract: Wrote texture 0 to textures_img0.png\nExporting to OBJ format...\nparam = mesh_with_textures.obj\nparam = -ptv\nassimp export: select file format: 'obj' (Wavefront OBJ format)\nLaunching asset import ... OK\nValidating postprocessing flags ... OK\n0 %\n50 %\n50 %\n51.5152 %\n53.0303 %\n54.5455 %\n56.0606 %\n57.5758 %\n59.0909 %\n60.6061 %\n62.1212 %\n63.6364 %\n65.1515 %\n66.6667 %\n68.1818 %\n69.697 %\n71.2121 %\n72.7273 %\n74.2424 %\n75.7576 %\n77.2727 %\n78.7879 %\n80.303 %\n81.8182 %\n83.3333 %\n84.8485 %\n86.3636 %\n87.8788 %\n89.3939 %\n90.9091 %\n92.4242 %\n93.9394 %\n95.4546 %\n96.9697 %\n98.4848 %\n100 %\nImporting file ... OK\nimport took approx. 0.00741 seconds\nLaunching asset export ... OK\nExporting file ... OK\nexport took approx. 0.14602 seconds\nassimp export: wrote output file: mesh_with_textures.obj\nFixing texture references in MTL file...\nsed: can't read : No such file or directory\nConverting to VOX format with resolution 64...\nReading mesh_with_textures.obj\nReading mesh_with_textures.mtl.... found\nmesh_with_textures.mtl NOT FOUND or not supported format\ntextures_img0.png loaded successfully\nScale factor used (voxel/polygon units):32.560181\nx:0..46, y:0..35, z:0..64\nWriting tmp.vox (47x36x65)\n0.24 seconds\nDone.\nConverting to MagicaVoxel format...\nSkipping SVOX, GLTF, and GLB generation as requested\nConversion complete: output/mesh_small.vox\nCleaning up intermediate files...",
"output": [
"https://replicate.delivery/yhqm/xvQwnQKEPm6tG5fynEefERcdXMukSMQSIF5kzXMTCQudMX3oA/a_wizard_in_a_purple_robe_and_pointed_hat_wielding.vox.glb",
"https://replicate.delivery/yhqm/J1LB7JM0szJ3LRDsxvP1yUPyViK4uw7r3AmUUSwjizpj56GF/a_wizard_in_a_purple_robe_and_pointed_hat_wielding_large.vox",
"https://replicate.delivery/yhqm/PApPmBt5FPqMCd7KmS9DCQol4fr8bfxYKI0E29jE1PzOmrbUA/a_wizard_in_a_purple_robe_and_pointed_hat_wielding_medium.vox",
"https://replicate.delivery/yhqm/I5RsuevdxRw4Sa1Mc2AyZ1d3bfshgrBcTpGObxaFAvaOmrbUA/a_wizard_in_a_purple_robe_and_pointed_hat_wielding_small.vox"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-24T07:16:55.984Z",
"started_at": "2025-03-24T07:17:02.706813Z",
"completed_at": "2025-03-24T07:19:42.144848Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/f86cxbqt61rj00cnrw1bxhg2gw/cancel",
"get": "https://api.replicate.com/v1/predictions/f86cxbqt61rj00cnrw1bxhg2gw",
"stream": "https://stream.replicate.com/v1/files/yswh-sun55bctcslplmtsyzkcmrv6alvyjhfmn67an3puej2vwpiswjta",
"web": "https://replicate.com/p/f86cxbqt61rj00cnrw1bxhg2gw"
},
"metrics": {
"predict_time": 159.438035477,
"total_time": 166.160848
}
}