Skip to content

Commit

Permalink
Merge branch 'main' into sd3-controlnet-ipadapter
Browse files Browse the repository at this point in the history
  • Loading branch information
guiyrt authored Dec 24, 2024
2 parents 18dfeaa + 825979d commit e80646a
Show file tree
Hide file tree
Showing 59 changed files with 107 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Test installing diffusers and importing
run: |
pip install diffusers && pip uninstall diffusers -y
pip install -i https://testpypi.python.org/pypi diffusers
pip install -i https://test.pypi.org/simple/ diffusers
python -c "from diffusers import __version__; print(__version__)"
python -c "from diffusers import DiffusionPipeline; pipe = DiffusionPipeline.from_pretrained('fusing/unet-ldm-dummy-update'); pipe()"
python -c "from diffusers import DiffusionPipeline; pipe = DiffusionPipeline.from_pretrained('hf-internal-testing/tiny-stable-diffusion-pipe', safety_checker=None); pipe('ah suh du')"
Expand Down
4 changes: 4 additions & 0 deletions docs/source/en/community_projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ Happy exploring, and thank you for being part of the Diffusers community!
<td><a href="https://github.com/Netwrck/stable-diffusion-server"> Stable Diffusion Server </a></td>
<td>A server configured for Inpainting/Generation/img2img with one stable diffusion model</td>
</tr>
<tr style="border-top: 2px solid black">
<td><a href="https://github.com/suzukimain/auto_diffusers"> Model Search </a></td>
<td>Search models on Civitai and Hugging Face</td>
</tr>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/cogvideo/train_cogvideox_image_to_video_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/cogvideo/train_cogvideox_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/community/marigold_depth_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")


class MarigoldDepthOutput(BaseOutput):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)
if is_torch_npu_available():
Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_sd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)
if is_torch_npu_available():
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_diffusion/train_custom_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

# Cache compiled models across invocations of this script.
cc.initialize_cache(os.path.expanduser("~/.cache/jax/compilation_cache"))
Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora_sana.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora_sd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_sd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
9 changes: 7 additions & 2 deletions examples/flux-control/train_control_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down Expand Up @@ -795,7 +795,7 @@ def main(args):
flux_transformer.x_embedder = new_linear

assert torch.all(flux_transformer.x_embedder.weight[:, initial_input_channels:].data == 0)
flux_transformer.register_to_config(in_channels=initial_input_channels * 2)
flux_transformer.register_to_config(in_channels=initial_input_channels * 2, out_channels=initial_input_channels)

def unwrap_model(model):
model = accelerator.unwrap_model(model)
Expand Down Expand Up @@ -1166,6 +1166,11 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
flux_transformer.to(torch.float32)
flux_transformer.save_pretrained(args.output_dir)

del flux_transformer
del text_encoding_pipeline
del vae
free_memory()

# Run a final round of validation.
image_logs = None
if args.validation_prompt is not None:
Expand Down
9 changes: 7 additions & 2 deletions examples/flux-control/train_control_lora_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down Expand Up @@ -830,7 +830,7 @@ def main(args):
flux_transformer.x_embedder = new_linear

assert torch.all(flux_transformer.x_embedder.weight[:, initial_input_channels:].data == 0)
flux_transformer.register_to_config(in_channels=initial_input_channels * 2)
flux_transformer.register_to_config(in_channels=initial_input_channels * 2, out_channels=initial_input_channels)

if args.train_norm_layers:
for name, param in flux_transformer.named_parameters():
Expand Down Expand Up @@ -1319,6 +1319,11 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
transformer_lora_layers=transformer_lora_layers,
)

del flux_transformer
del text_encoding_pipeline
del vae
free_memory()

# Run a final round of validation.
image_logs = None
if args.validation_prompt is not None:
Expand Down
2 changes: 1 addition & 1 deletion examples/instruct_pix2pix/train_instruct_pix2pix.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/t2i_adapter/train_t2i_adapter_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.32.0.dev0")
check_min_version("0.33.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
Loading

0 comments on commit e80646a

Please sign in to comment.