Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Fixes #3209

… done so far and provide feedback for Jules to continue.
… done so far and provide feedback for Jules to continue.
This change addresses an issue where the application could not access files on external drives or other locations due to Gradio's security restrictions.

To solve this, I have implemented the following changes:

- **`kohya_gui/class_gui_config.py`:**
  - Added a new property to the `KohyaSSGUIConfig` class to handle the `allowed_paths` configuration.
  - This new property reads a new `allowed_paths` option from the `[server]` section of the `config.toml` file.

- **`kohya_gui.py`:**
  - In the `UI` function, the `allowed_paths` are now read from the `KohyaSSGUIConfig` object.
  - The `allowed_paths` are then added to the `launch_params` dictionary before calling `ui_interface.launch()`.

- **`test/test_allowed_paths.py`:**
  - A new test script has been added to verify the changes.
  - This test creates a temporary directory, a dummy file, and a `config.toml` file that allows access to the temporary directory.
  - It then runs the `kohya_gui.py` script with the new configuration and checks if the application can access the dummy file.

I was unable to run the test due to issues with the testing environment. I have included the test file, and I believe the code is correct based on my implementation.
@bmaltais bmaltais closed this Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual Captioning (editing) with latest version, doesn't work

1 participant