You're looking at a specific version of this model. Jump to the model overview.
iordcalin /material-transfer:2f640c88
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run iordcalin/material-transfer using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"iordcalin/material-transfer:2f640c887323bae445f8b5154d010b2d31c336dd5f3a1d85acd5ae04d215dea0",
{
input: {
steps: 12,
prompt: "stone sculpture, lava",
max_width: 1920,
max_height: 1920,
output_format: "webp",
subject_image: "https://replicate.delivery/pbxt/KqN31nhKDQaptRlVx3KPeBZNTJLgRVucfitwWhTScFEQ4IuA/0_3.webp",
guidance_scale: 2,
material_image: "https://replicate.delivery/pbxt/KqN31hxUxRUgIGgX2L0YMXblKlh5omIIW3L1rxQydEVEU5lf/8J8vDdmH.png",
output_quality: 80,
negative_prompt: "hair",
material_strength: "medium",
return_intermediate_images: false
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run iordcalin/material-transfer using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"iordcalin/material-transfer:2f640c887323bae445f8b5154d010b2d31c336dd5f3a1d85acd5ae04d215dea0",
input={
"steps": 12,
"prompt": "stone sculpture, lava",
"max_width": 1920,
"max_height": 1920,
"output_format": "webp",
"subject_image": "https://replicate.delivery/pbxt/KqN31nhKDQaptRlVx3KPeBZNTJLgRVucfitwWhTScFEQ4IuA/0_3.webp",
"guidance_scale": 2,
"material_image": "https://replicate.delivery/pbxt/KqN31hxUxRUgIGgX2L0YMXblKlh5omIIW3L1rxQydEVEU5lf/8J8vDdmH.png",
"output_quality": 80,
"negative_prompt": "hair",
"material_strength": "medium",
"return_intermediate_images": False
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run iordcalin/material-transfer 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": "2f640c887323bae445f8b5154d010b2d31c336dd5f3a1d85acd5ae04d215dea0",
"input": {
"steps": 12,
"prompt": "stone sculpture, lava",
"max_width": 1920,
"max_height": 1920,
"output_format": "webp",
"subject_image": "https://replicate.delivery/pbxt/KqN31nhKDQaptRlVx3KPeBZNTJLgRVucfitwWhTScFEQ4IuA/0_3.webp",
"guidance_scale": 2,
"material_image": "https://replicate.delivery/pbxt/KqN31hxUxRUgIGgX2L0YMXblKlh5omIIW3L1rxQydEVEU5lf/8J8vDdmH.png",
"output_quality": 80,
"negative_prompt": "hair",
"material_strength": "medium",
"return_intermediate_images": false
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run iordcalin/material-transfer using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/fofr/material-transfer@sha256:2f640c887323bae445f8b5154d010b2d31c336dd5f3a1d85acd5ae04d215dea0 \
-i 'steps=12' \
-i 'prompt="stone sculpture, lava"' \
-i 'max_width=1920' \
-i 'max_height=1920' \
-i 'output_format="webp"' \
-i 'subject_image="https://replicate.delivery/pbxt/KqN31nhKDQaptRlVx3KPeBZNTJLgRVucfitwWhTScFEQ4IuA/0_3.webp"' \
-i 'guidance_scale=2' \
-i 'material_image="https://replicate.delivery/pbxt/KqN31hxUxRUgIGgX2L0YMXblKlh5omIIW3L1rxQydEVEU5lf/8J8vDdmH.png"' \
-i 'output_quality=80' \
-i 'negative_prompt="hair"' \
-i 'material_strength="medium"' \
-i 'return_intermediate_images=false'
To learn more, take a look at the Cog documentation.
Pull and run iordcalin/material-transfer using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/fofr/material-transfer@sha256:2f640c887323bae445f8b5154d010b2d31c336dd5f3a1d85acd5ae04d215dea0
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "steps": 12, "prompt": "stone sculpture, lava", "max_width": 1920, "max_height": 1920, "output_format": "webp", "subject_image": "https://replicate.delivery/pbxt/KqN31nhKDQaptRlVx3KPeBZNTJLgRVucfitwWhTScFEQ4IuA/0_3.webp", "guidance_scale": 2, "material_image": "https://replicate.delivery/pbxt/KqN31hxUxRUgIGgX2L0YMXblKlh5omIIW3L1rxQydEVEU5lf/8J8vDdmH.png", "output_quality": 80, "negative_prompt": "hair", "material_strength": "medium", "return_intermediate_images": false } }' \ http://localhost:5000/predictions
Add a payment method to run this model.
Each run costs approximately $0.12. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-05-01T15:15:16.647086Z",
"created_at": "2024-05-01T15:15:07.203000Z",
"data_removed": false,
"error": null,
"id": "grve9et18drgj0cf6jws1h7ger",
"input": {
"steps": 12,
"prompt": "stone sculpture, lava",
"max_width": 1920,
"max_height": 1920,
"output_format": "webp",
"subject_image": "https://replicate.delivery/pbxt/KqN31nhKDQaptRlVx3KPeBZNTJLgRVucfitwWhTScFEQ4IuA/0_3.webp",
"guidance_scale": 2,
"material_image": "https://replicate.delivery/pbxt/KqN31hxUxRUgIGgX2L0YMXblKlh5omIIW3L1rxQydEVEU5lf/8J8vDdmH.png",
"output_quality": 80,
"negative_prompt": "hair",
"material_strength": "medium",
"return_intermediate_images": false
},
"logs": "Random seed set to: 2831156950\nChecking inputs\n✅ /tmp/inputs/subject.png\n✅ /tmp/inputs/material.png\n====================================\nChecking weights\nIncluding weights for IPAdapter preset: STANDARD (medium strength)\n✅ depth_anything_vits14.pth\n✅ sk_model.pth\n✅ juggernautXL_juggernautX.safetensors\n✅ depth_anything_vitl14.pth\n✅ CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors\n✅ ip-adapter_sdxl_vit-h.safetensors\n✅ ip-adapter_sd15.safetensors\n✅ t2i-adapter_diffusers_xl_lineart.safetensors\n✅ depth_anything_vitb14.pth\n✅ t2i-adapter_diffusers_xl_depth_midas.safetensors\n✅ sk_model2.pth\n====================================\nRunning workflow\ngot prompt\nExecuting node 10, title: KSampler (Efficient), class type: KSampler (Efficient)\n 0%| | 0/12 [00:00<?, ?it/s]\n 8%|▊ | 1/12 [00:00<00:08, 1.31it/s]\n 17%|█▋ | 2/12 [00:01<00:05, 1.74it/s]\n 25%|██▌ | 3/12 [00:01<00:04, 1.94it/s]\n 33%|███▎ | 4/12 [00:02<00:03, 2.05it/s]\n 42%|████▏ | 5/12 [00:02<00:03, 2.12it/s]\n 50%|█████ | 6/12 [00:02<00:02, 2.15it/s]\n 58%|█████▊ | 7/12 [00:03<00:02, 2.19it/s]\n 67%|██████▋ | 8/12 [00:03<00:01, 2.22it/s]\n 75%|███████▌ | 9/12 [00:04<00:01, 2.24it/s]\n 83%|████████▎ | 10/12 [00:04<00:00, 2.28it/s]\n 92%|█████████▏| 11/12 [00:05<00:00, 2.33it/s]\n100%|██████████| 12/12 [00:05<00:00, 2.77it/s]\n100%|██████████| 12/12 [00:05<00:00, 2.25it/s]\nExecuting node 9, title: Save Image, class type: SaveImage\nPrompt executed in 5.86 seconds\noutputs: {'56': {'images': [{'filename': 'ComfyUI_temp_pgjop_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '57': {'images': [{'filename': 'ComfyUI_temp_fxoap_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '39': {'images': [{'filename': 'ComfyUI_temp_eiuhe_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '40': {'images': [{'filename': 'ComfyUI_temp_uypkg_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '58': {'images': [{'filename': 'ComfyUI_temp_npmga_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '10': {'images': [{'filename': 'ComfyUI_temp_xbbkc_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '9': {'images': [{'filename': 'ComfyUI_00001_.png', 'subfolder': '', 'type': 'output'}]}}\n====================================\nContents of /tmp/outputs:\nComfyUI_00001_.png",
"metrics": {
"predict_time": 9.390225,
"total_time": 9.444086
},
"output": [
"https://replicate.delivery/pbxt/hFlz5CYcDfW5XSGXvm3RtZWFB9WE8UeGT50es3LzYhoH0BglA/ComfyUI_00001_.webp"
],
"started_at": "2024-05-01T15:15:07.256861Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/grve9et18drgj0cf6jws1h7ger",
"cancel": "https://api.replicate.com/v1/predictions/grve9et18drgj0cf6jws1h7ger/cancel"
},
"version": "2f640c887323bae445f8b5154d010b2d31c336dd5f3a1d85acd5ae04d215dea0"
}
Random seed set to: 2831156950
Checking inputs
✅ /tmp/inputs/subject.png
✅ /tmp/inputs/material.png
====================================
Checking weights
Including weights for IPAdapter preset: STANDARD (medium strength)
✅ depth_anything_vits14.pth
✅ sk_model.pth
✅ juggernautXL_juggernautX.safetensors
✅ depth_anything_vitl14.pth
✅ CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors
✅ ip-adapter_sdxl_vit-h.safetensors
✅ ip-adapter_sd15.safetensors
✅ t2i-adapter_diffusers_xl_lineart.safetensors
✅ depth_anything_vitb14.pth
✅ t2i-adapter_diffusers_xl_depth_midas.safetensors
✅ sk_model2.pth
====================================
Running workflow
got prompt
Executing node 10, title: KSampler (Efficient), class type: KSampler (Efficient)
0%| | 0/12 [00:00<?, ?it/s]
8%|▊ | 1/12 [00:00<00:08, 1.31it/s]
17%|█▋ | 2/12 [00:01<00:05, 1.74it/s]
25%|██▌ | 3/12 [00:01<00:04, 1.94it/s]
33%|███▎ | 4/12 [00:02<00:03, 2.05it/s]
42%|████▏ | 5/12 [00:02<00:03, 2.12it/s]
50%|█████ | 6/12 [00:02<00:02, 2.15it/s]
58%|█████▊ | 7/12 [00:03<00:02, 2.19it/s]
67%|██████▋ | 8/12 [00:03<00:01, 2.22it/s]
75%|███████▌ | 9/12 [00:04<00:01, 2.24it/s]
83%|████████▎ | 10/12 [00:04<00:00, 2.28it/s]
92%|█████████▏| 11/12 [00:05<00:00, 2.33it/s]
100%|██████████| 12/12 [00:05<00:00, 2.77it/s]
100%|██████████| 12/12 [00:05<00:00, 2.25it/s]
Executing node 9, title: Save Image, class type: SaveImage
Prompt executed in 5.86 seconds
outputs: {'56': {'images': [{'filename': 'ComfyUI_temp_pgjop_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '57': {'images': [{'filename': 'ComfyUI_temp_fxoap_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '39': {'images': [{'filename': 'ComfyUI_temp_eiuhe_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '40': {'images': [{'filename': 'ComfyUI_temp_uypkg_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '58': {'images': [{'filename': 'ComfyUI_temp_npmga_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '10': {'images': [{'filename': 'ComfyUI_temp_xbbkc_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '9': {'images': [{'filename': 'ComfyUI_00001_.png', 'subfolder': '', 'type': 'output'}]}}
====================================
Contents of /tmp/outputs:
ComfyUI_00001_.png