Skip to content

Commit bdb62af

Browse files
Merge branch 'CyberTimon:main' into feat-brush-resizing-shortcuts
2 parents 0938e98 + 367b50c commit bdb62af

3 files changed

Lines changed: 182 additions & 209 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ RapidRAW is still in active development and isn't yet as polished as mature tool
6060
<details>
6161
<summary><strong>Recent Changes</strong></summary>
6262

63+
- **2026-03-30:** LaMa inpainting for lightweight local content-aware fill and object removal.
6364
- **2026-03-26:** Performance improvements & new flat list mode for library
6465
- **2026-03-25:** Optimize folder loading & tree fetching
6566
- **2026-03-23:** Generate thumbnails only for visible viewport items
@@ -69,11 +70,11 @@ RapidRAW is still in active development and isn't yet as polished as mature tool
6970
- **2026-03-16:** LRU cache for instant image loading
7071
- **2026-03-15:** Improved high quality subject mask models, various UI improvements and shader improvements
7172
- **2026-03-14:** New image analytics panel which can display vectorscopes, waveforms, parades & histograms
72-
- **2026-03-13:** JPEG XL, WebP, and additional format support, including the ability to export LUTs.
7373

7474
<details>
7575
<summary><strong>Expand further</strong></summary>
7676

77+
- **2026-03-13:** JPEG XL, WebP, and additional format support, including the ability to export LUTs.
7778
- **2026-03-12:** Added parametric color & luminance masks
7879
- **2026-03-10:** Implement region of interest rendering to improve performance when zooming in
7980
- **2026-03-07:** Batch negative conversion & various shader improvements

src-tauri/src/ai_processing.rs

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,24 @@ pub async fn get_or_init_ai_models(
211211
ai_state_mutex: &Mutex<Option<AiState>>,
212212
ai_init_lock: &TokioMutex<()>,
213213
) -> Result<Arc<AiModels>> {
214-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
215-
if let Some(models) = &ai_state.models {
216-
return Ok(models.clone());
217-
}
214+
if let Some(models) = ai_state_mutex
215+
.lock()
216+
.unwrap()
217+
.as_ref()
218+
.and_then(|state| state.models.clone())
219+
{
220+
return Ok(models);
218221
}
219222

220223
let _guard = ai_init_lock.lock().await;
221224

222-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
223-
if let Some(models) = &ai_state.models {
224-
return Ok(models.clone());
225-
}
225+
if let Some(models) = ai_state_mutex
226+
.lock()
227+
.unwrap()
228+
.as_ref()
229+
.and_then(|state| state.models.clone())
230+
{
231+
return Ok(models);
226232
}
227233

228234
let models_dir = get_models_dir(app_handle)?;
@@ -306,18 +312,24 @@ pub async fn get_or_init_denoise_model(
306312
ai_state_mutex: &Mutex<Option<AiState>>,
307313
ai_init_lock: &TokioMutex<()>,
308314
) -> Result<Arc<Mutex<Session>>> {
309-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
310-
if let Some(denoise_model) = &ai_state.denoise_model {
311-
return Ok(denoise_model.clone());
312-
}
315+
if let Some(denoise_model) = ai_state_mutex
316+
.lock()
317+
.unwrap()
318+
.as_ref()
319+
.and_then(|state| state.denoise_model.clone())
320+
{
321+
return Ok(denoise_model);
313322
}
314323

315324
let _guard = ai_init_lock.lock().await;
316325

317-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
318-
if let Some(denoise_model) = &ai_state.denoise_model {
319-
return Ok(denoise_model.clone());
320-
}
326+
if let Some(denoise_model) = ai_state_mutex
327+
.lock()
328+
.unwrap()
329+
.as_ref()
330+
.and_then(|state| state.denoise_model.clone())
331+
{
332+
return Ok(denoise_model);
321333
}
322334

323335
let models_dir = get_models_dir(app_handle)?;
@@ -359,18 +371,24 @@ pub async fn get_or_init_clip_models(
359371
ai_state_mutex: &Mutex<Option<AiState>>,
360372
ai_init_lock: &TokioMutex<()>,
361373
) -> Result<Arc<ClipModels>> {
362-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
363-
if let Some(clip_models) = &ai_state.clip_models {
364-
return Ok(clip_models.clone());
365-
}
374+
if let Some(clip_models) = ai_state_mutex
375+
.lock()
376+
.unwrap()
377+
.as_ref()
378+
.and_then(|state| state.clip_models.clone())
379+
{
380+
return Ok(clip_models);
366381
}
367382

368383
let _guard = ai_init_lock.lock().await;
369384

370-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
371-
if let Some(clip_models) = &ai_state.clip_models {
372-
return Ok(clip_models.clone());
373-
}
385+
if let Some(clip_models) = ai_state_mutex
386+
.lock()
387+
.unwrap()
388+
.as_ref()
389+
.and_then(|state| state.clip_models.clone())
390+
{
391+
return Ok(clip_models);
374392
}
375393

376394
let models_dir = get_models_dir(app_handle)?;
@@ -423,18 +441,24 @@ pub async fn get_or_init_lama_model(
423441
ai_state_mutex: &Mutex<Option<AiState>>,
424442
ai_init_lock: &TokioMutex<()>,
425443
) -> Result<Arc<Mutex<Session>>> {
426-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
427-
if let Some(lama_model) = &ai_state.lama_model {
428-
return Ok(lama_model.clone());
429-
}
444+
if let Some(lama_model) = ai_state_mutex
445+
.lock()
446+
.unwrap()
447+
.as_ref()
448+
.and_then(|state| state.lama_model.clone())
449+
{
450+
return Ok(lama_model);
430451
}
431452

432453
let _guard = ai_init_lock.lock().await;
433454

434-
if let Some(ai_state) = ai_state_mutex.lock().unwrap().as_ref() {
435-
if let Some(lama_model) = &ai_state.lama_model {
436-
return Ok(lama_model.clone());
437-
}
455+
if let Some(lama_model) = ai_state_mutex
456+
.lock()
457+
.unwrap()
458+
.as_ref()
459+
.and_then(|state| state.lama_model.clone())
460+
{
461+
return Ok(lama_model);
438462
}
439463

440464
let models_dir = get_models_dir(app_handle)?;

0 commit comments

Comments
 (0)