vc-runtime 0.1.0

Runtime backend for Visual Compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use anyhow::Result;
use bytes::Bytes;
use vc_shared::hashing::{sha256, Sha256Digest};

use super::api::ComfyClient;
use super::types::ImageOutput;

pub async fn download_and_hash(
    client: &ComfyClient,
    image: &ImageOutput,
) -> Result<(Bytes, Sha256Digest)> {
    let bytes = client.download_image(image).await?;
    let hash = sha256(&bytes);
    Ok((bytes, hash))
}