inpaint.rs
1 use image::{DynamicImage, GrayImage, Luma}; 2 3 #[derive(Debug)] 4 pub struct InpaintParams { 5 pub prompt: String, 6 pub negative_prompt: Option<String>, 7 pub width: Option<u32>, 8 pub height: Option<u32>, 9 pub image: DynamicImage, 10 pub mask: DynamicImage, 11 pub strength: f32, 12 pub steps: usize, 13 pub guidance_scale: f32, 14 pub seed: Option<u64>, 15 } 16 17 impl Default for InpaintParams { 18 fn default() -> Self { 19 Self { 20 prompt: String::new(), 21 negative_prompt: None, 22 width: None, 23 height: None, 24 image: DynamicImage::new_rgb8(1024, 1024), 25 mask: DynamicImage::ImageLuma8(GrayImage::from_fn(1024, 1024, |_, _| Luma([255]))), 26 strength: 0.75, 27 steps: 40, 28 guidance_scale: 7.5, 29 seed: None, 30 } 31 } 32 }