"path_outputs" in config.txt is ignored
path_outputs is introduced in config.txt for storing generated images. But Fooocus-API ignores the setting, outputs images to a hard-coded folder output_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..', 'outputs', 'files')) in file_utils.py. I think it's important to expose the configuration of path_outputs to users, especially for API running in Docker container.
My workaround to solve the problem:
output_dir_var = os.environ.get('OUTPUT_DIR', "/tmp")
output_dir = os.path.abspath(os.path.join(output_dir_var, 'files'))
Developer can customize the output path by set an environment variable, e.g. export OUTPUT_DIR=/tmp/fooocus-imgs
Okay, this is a headache inducing question. I will try to improve this.
In config.py:
if not os.path.exists('user_path_config.txt'):
return
This should always return since "user_path_config.txt" doesn't exist. Saving "config.txt" to "user_path_config.txt" results in:
Processing deprecated config failed
Oddly, one day logs and images were written to path_outputs.
In config.py:
if not os.path.exists('user_path_config.txt'): returnThis should always return since "user_path_config.txt" doesn't exist. Saving "config.txt" to "user_path_config.txt" results in:
Processing deprecated config failed
Oddly, one day logs and images were written to path_outputs.
config.py actually is cloned from Fooocus project. If you just want to run Fooocus, the user_path configuration is working fine. The problem here is that Fooocus-API is not aware the setting of config.py in Fooocus. I think the easiest way would be setup a new environment variable to do so.
The settings from config.txt still work. It still generates the file in the path_outputs directory, but then the file will be moved. You can copy the file instead of moving the file. Then both, the API and the log work without confusion. Files from the API directory can be cleared later. I want to keep the files in the log.