asppj / cog-comfyui-img

  • Public
  • 11 runs
  • T4
Iterate in playground

Input

pip install replicate
Set the REPLICATE_API_TOKEN environment variable:
export REPLICATE_API_TOKEN=<paste-your-token-here>

Find your API token in your account settings.

Import the client:
import replicate

Run asppj/cog-comfyui-img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

output = replicate.run(
    "asppj/cog-comfyui-img:c493b0bb1bb7d8ccbc95ff0a7787a093a018d28976e728742fda6c44f17ccc5e",
    input={
        "output_format": "webp",
        "workflow_json": "{\"3\": {\"inputs\": {\"seed\": 237514639057514, \"steps\": 20, \"cfg\": 2.5, \"sampler_name\": \"euler\", \"scheduler\": \"karras\", \"denoise\": 1, \"model\": [\"14\", 0], \"positive\": [\"12\", 0], \"negative\": [\"12\", 1], \"latent_image\": [\"12\", 2]}, \"class_type\": \"KSampler\", \"_meta\": {\"title\": \"KSampler\"}}, \"8\": {\"inputs\": {\"samples\": [\"3\", 0], \"vae\": [\"15\", 2]}, \"class_type\": \"VAEDecode\", \"_meta\": {\"title\": \"VAE Decode\"}}, \"10\": {\"inputs\": {\"filename_prefix\": \"ComfyUI\", \"fps\": 10, \"lossless\": false, \"quality\": 85, \"method\": \"default\", \"images\": [\"8\", 0]}, \"class_type\": \"SaveAnimatedWEBP\", \"_meta\": {\"title\": \"SaveAnimatedWEBP\"}}, \"12\": {\"inputs\": {\"width\": 1024, \"height\": 576, \"video_frames\": 25, \"motion_bucket_id\": 127, \"fps\": 6, \"augmentation_level\": 0, \"clip_vision\": [\"15\", 1], \"init_image\": [\"20\", 0], \"vae\": [\"15\", 2]}, \"class_type\": \"SVD_img2vid_Conditioning\", \"_meta\": {\"title\": \"SVD_img2vid_Conditioning\"}}, \"14\": {\"inputs\": {\"min_cfg\": 1, \"model\": [\"15\", 0]}, \"class_type\": \"VideoLinearCFGGuidance\", \"_meta\": {\"title\": \"VideoLinearCFGGuidance\"}}, \"15\": {\"inputs\": {\"ckpt_name\": \"svd_xt.safetensors\"}, \"class_type\": \"ImageOnlyCheckpointLoader\", \"_meta\": {\"title\": \"Image Only Checkpoint Loader (img2vid model)\"}}, \"16\": {\"inputs\": {\"ckpt_name\": \"sd_xl_base_1.0.safetensors\"}, \"class_type\": \"CheckpointLoaderSimple\", \"_meta\": {\"title\": \"Load Checkpoint\"}}, \"17\": {\"inputs\": {\"seed\": 144698910769133, \"steps\": 15, \"cfg\": 8, \"sampler_name\": \"uni_pc_bh2\", \"scheduler\": \"normal\", \"denoise\": 1, \"model\": [\"16\", 0], \"positive\": [\"18\", 0], \"negative\": [\"19\", 0], \"latent_image\": [\"22\", 0]}, \"class_type\": \"KSampler\", \"_meta\": {\"title\": \"KSampler\"}}, \"18\": {\"inputs\": {\"text\": \"A dramatic scene of a rocket launch at dawn with logo ihandy name, with a towering rocket on the launch pad, surrounded by a cloud of smoke and flames. The sky is painted in shades of orange and purple as the sun rises, casting a warm glow on the scene. Ground crew in the foreground, wearing safety gear, are monitoring the launch. The rocket is detailed with futuristic designs and logos, and the launch pad is equipped with various technical equipment. The atmosphere is filled with excitement and anticipation.\", \"clip\": [\"16\", 1]}, \"class_type\": \"CLIPTextEncode\", \"_meta\": {\"title\": \"CLIP Text Encode (Prompt)\"}}, \"19\": {\"inputs\": {\"text\": \"watermark\", \"clip\": [\"16\", 1]}, \"class_type\": \"CLIPTextEncode\", \"_meta\": {\"title\": \"CLIP Text Encode (Prompt)\"}}, \"20\": {\"inputs\": {\"samples\": [\"17\", 0], \"vae\": [\"16\", 2]}, \"class_type\": \"VAEDecode\", \"_meta\": {\"title\": \"VAE Decode\"}}, \"21\": {\"inputs\": {\"images\": [\"20\", 0]}, \"class_type\": \"PreviewImage\", \"_meta\": {\"title\": \"Preview Image\"}}, \"22\": {\"inputs\": {\"width\": 1024, \"height\": 576, \"batch_size\": 1}, \"class_type\": \"EmptyLatentImage\", \"_meta\": {\"title\": \"Empty Latent Image\"}}}",
        "output_quality": 95,
        "randomise_seeds": True,
        "force_reset_cache": False,
        "return_temp_files": False
    }
)

# 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.

Output

No output yet! Press "Submit" to start a prediction.

Run time and cost

This model runs on Nvidia T4 GPU hardware. We don't yet have enough runs of this model to provide performance information.

Readme

This model doesn't have a readme.