Run hongchaodeng/cog-cog-stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"hongchaodeng/cog-cog-stable-diffusion:ad59a4472eb2f99b3d3a7352a1b375625ed5a50ab8c8f4361842a502c8af0f54",
input={
"width": 128,
"height": 128,
"prompt": "a photo of an astronaut riding a horse on mars",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"num_inference_steps": 8
}
)
# To access the file URL:print(output[0].url())
#=> "http://example.com"# To write the file to disk:withopen("my-image.png", "wb") as file:
file.write(output[0].read())
This model is not yet booted but ready for API calls. Your first API call will boot the model and may take longer, but after that subsequent responses will be fast.
This model costs approximately $0.0058 to run on Replicate, but this varies depending on your inputs.