Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
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
24 changes: 15 additions & 9 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 @@ -229,16 +231,20 @@ def create(**kwargs) -> Optional['DocumentArray']:

_name = _args.name_docarray

pb_path = os.path.join(get_output_dir(_name), 'da.protobuf.lz4')
if (
'DISCOART_DISABLE_RESULT_SUMMARY' not in os.environ
and 'DISCOART_DISABLE_IPYTHON' not in os.environ
):
pb_path = os.path.join(get_output_dir(_name), 'da.protobuf.lz4')

if os.path.exists(pb_path) and is_exit0:
_da = DocumentArray.load_binary(pb_path)
if os.path.exists(pb_path) and is_exit0:
_da = DocumentArray.load_binary(pb_path)

if (
'DISCOART_DISABLE_RESULT_SUMMARY' not in os.environ
and 'DISCOART_DISABLE_IPYTHON' not in os.environ
):
show_result_summary(_da, _name, _args)
if (
'DISCOART_DISABLE_RESULT_SUMMARY' not in os.environ
and 'DISCOART_DISABLE_IPYTHON' not in os.environ
):
show_result_summary(_da, _name, _args)


def go_big(
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