Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add silent mode #178

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ You can set environment variables to control the meta-behavior of DiscoArt. The
```bash
DISCOART_LOG_LEVEL='DEBUG' # more verbose logs
DISCOART_OPTOUT_CLOUD_BACKUP='1' # opt-out from cloud backup
DISCOART_OPTOUT_LOCAL_BACKUP='1' # opt-out from local backup
DISCOART_DISABLE_IPYTHON='1' # disable ipython dependency
DISCOART_DISABLE_RESULT_SUMMARY='1' # disable result summary after the run ends
DISCOART_DISABLE_ARGS_TABLE='1' # disable args table before the run starts
DISCOART_DEFAULT_PARAMETERS_YAML='path/to/your-default.yml' # use a custom default parameters file
DISCOART_CUT_SCHEDULES_YAML='path/to/your-schedules.yml' # use a custom cut schedules file
DISCOART_MODELS_YAML='path/to/your-models.yml' # use a custom list of models file
Expand Down
1 change: 1 addition & 0 deletions discoart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

from .create import create, go_big
from .config import cheatsheet, show_config, save_config, load_config
from .helper import get_output_dir
8 changes: 5 additions & 3 deletions discoart/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ def create(**kwargs) -> Optional['DocumentArray']:
else:
_args = load_config(user_config=kwargs)

print_args_table(_args)
if 'DISCOART_DISABLE_ARGS_TABLE' not in os.environ:
print_args_table(_args)

_args = SimpleNamespace(**_args)

from .helper import (
Expand Down Expand Up @@ -220,10 +222,10 @@ def create(**kwargs) -> Optional['DocumentArray']:
device=device,
events=events,
)
is_exit0 = True
is_exit0 = 'DISCOART_OPTOUT_LOCAL_BACKUP' not in os.environ
return da
except KeyboardInterrupt:
is_exit0 = True
is_exit0 = 'DISCOART_OPTOUT_LOCAL_BACKUP' not in os.environ
finally:
free_memory()

Expand Down
2 changes: 2 additions & 0 deletions discoart/persist.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _local_save(
is_sampling_done: threading.Event,
force: bool = False,
) -> None:
if 'DISCOART_OPTOUT_LOCAL_BACKUP' in os.environ:
return
if is_busy_event.is_set() and not force:
logger.debug(f'another save is running, skipping')
return
Expand Down
2 changes: 1 addition & 1 deletion discoart/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def do_run(
logger.info('preparing models...')

model, diffusion, clip_models, secondary_model = models
lpips_model = lpips.LPIPS(net='vgg').to(device)
lpips_model = lpips.LPIPS(net='vgg', verbose=False).to(device)

side_x, side_y = ((args.width_height[j] // 64) * 64 for j in (0, 1))

Expand Down