Skip to content

Commit

Permalink
Merge pull request #1082 from bghira/dependency/diffusers-update
Browse files Browse the repository at this point in the history
update to diffusers v0.31 for SD3.5
  • Loading branch information
bghira authored Oct 22, 2024
2 parents ddc7789 + 362a7b6 commit aec04fc
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 49 deletions.
8 changes: 6 additions & 2 deletions helpers/data_backend/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,11 @@ def configure_multi_databackend(args: dict, accelerator, text_encoders, tokenize
raise ValueError("Each dataset needs a unique 'id' field.")
info_log(f"Configuring data backend: {backend['id']}")
conditioning_type = backend.get("conditioning_type")
if backend.get("dataset_type") == "conditioning" or conditioning_type is not None:
backend['dataset_type'] = 'conditioning'
if (
backend.get("dataset_type") == "conditioning"
or conditioning_type is not None
):
backend["dataset_type"] = "conditioning"
resolution_type = backend.get("resolution_type", args.resolution_type)
if resolution_type == "pixel_area":
pixel_edge_length = backend.get("resolution", int(args.resolution))
Expand Down Expand Up @@ -897,6 +900,7 @@ def configure_multi_databackend(args: dict, accelerator, text_encoders, tokenize
),
instance_prompt=backend.get("instance_prompt", args.instance_prompt),
conditioning_type=conditioning_type,
is_regularisation_data=is_regularisation_data,
)
if init_backend["sampler"].caption_strategy == "parquet":
configure_parquet_database(backend, args, init_backend["data_backend"])
Expand Down
8 changes: 3 additions & 5 deletions helpers/multiaspect/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(
prepend_instance_prompt=False,
instance_prompt: str = None,
conditioning_type: str = None,
is_regularisation_data: bool = False,
):
"""
Initializes the sampler with provided settings.
Expand Down Expand Up @@ -67,6 +68,7 @@ def __init__(
f"Unknown conditioning image type: {conditioning_type}"
)
self.conditioning_type = conditioning_type
self.is_regularisation_data = is_regularisation_data

self.rank_info = rank_info()
self.accelerator = accelerator
Expand Down Expand Up @@ -377,10 +379,6 @@ def log_state(self, show_rank: bool = True, alt_stats: bool = False):
total_image_count *= self.accelerator.num_processes
total_image_count = f"~{total_image_count}"
data_backend_config = StateTracker.get_data_backend_config(self.id)
is_regularisation_data = data_backend_config.get(
"is_regularisation_data",
data_backend_config.get("is_regularization_data", False),
)
printed_state = (
f"- Repeats: {data_backend_config.get('repeats', 0)}\n"
f"- Total number of images: {total_image_count}\n"
Expand All @@ -389,7 +387,7 @@ def log_state(self, show_rank: bool = True, alt_stats: bool = False):
f"- Cropped: {data_backend_config.get('crop')}\n"
f"- Crop style: {'None' if not data_backend_config.get('crop') else data_backend_config.get('crop_style')}\n"
f"- Crop aspect: {'None' if not data_backend_config.get('crop') else data_backend_config.get('crop_aspect')}\n"
f"- Used for regularisation data: {'Yes' if is_regularisation_data else 'No'}\n"
f"- Used for regularisation data: {'Yes' if self.is_regularisation_data else 'No'}\n"
)
if self.conditioning_type:
printed_state += f"- Conditioning type: {self.conditioning_type}\n"
Expand Down
22 changes: 9 additions & 13 deletions install/apple/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion install/apple/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package-mode = false
python = ">=3.10,<3.13"
torch = "^2.5.0"
torchvision = "^0.20.0"
diffusers = {git = "https://github.com/huggingface/diffusers", rev = "quantization-config"}
diffusers = "^0.31.0"
transformers = "^4.44.2"
datasets = "^3.0.0"
wandb = "^0.18.1"
Expand Down
22 changes: 9 additions & 13 deletions install/rocm/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion install/rocm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ colorama = "^0.4.6"
compel = "^2"
datasets = "^3.0.0"
deepspeed = "^0.15.1"
diffusers = {git = "https://github.com/huggingface/diffusers", rev = "quantization-config"}
diffusers = "^0.31.0"
iterutils = "^0.1.6"
numpy = "1.26"
open-clip-torch = "^2.26.1"
Expand Down
22 changes: 9 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package-mode = false
python = ">=3.10,<3.12"
torch = {version = "^2.5.0+cu124", source = "pytorch"}
torchvision = {version = "^0.20.0+cu124", source = "pytorch"}
diffusers = {git = "https://github.com/huggingface/diffusers", rev = "quantization-config"}
diffusers = "^0.31.0"
transformers = "^4.45.1"
datasets = "^3.0.1"
bitsandbytes = "^0.44.1"
Expand Down

0 comments on commit aec04fc

Please sign in to comment.