Method
generate_image
(&mut self, args: ImageGenerationArgs, callback: F)
Source from the content-addressed store, hash-verified
| 171 | } |
| 172 | |
| 173 | pub async fn generate_image<F>(&mut self, args: ImageGenerationArgs, callback: F) -> Result<()> |
| 174 | where |
| 175 | F: FnMut(Vec<ImageBuffer<Rgb<u8>, Vec<u8>>>) + Send + 'static, |
| 176 | { |
| 177 | let model = self |
| 178 | .model |
| 179 | .as_mut() |
| 180 | .ok_or_else(|| anyhow::anyhow!("No image model loaded"))?; |
| 181 | model.generate_image(&args, Box::new(callback)).await |
| 182 | } |
| 183 | |
| 184 | pub async fn generate_audio(&mut self, args: &AudioGenerationArgs) -> Result<AudioOutput> { |
| 185 | let model = self |
Tested by
no test coverage detected