Skip to content

Commit e3cd6ca

Browse files
yiyixuxuyiyixuxusayakpaulDN6stevhliu
authored
update the signature of from_single_file (huggingface#7216)
* update the signature of from_single_file * Update src/diffusers/loaders/single_file.py Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/loaders/single_file.py Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/loaders/single_file.py Co-authored-by: Steven Liu <[email protected]> * Update src/diffusers/loaders/single_file.py Co-authored-by: Steven Liu <[email protected]> --------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Dhruv Nair <[email protected]> Co-authored-by: Steven Liu <[email protected]>
1 parent e5ee05d commit e3cd6ca

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/diffusers/loaders/single_file.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,30 @@ def from_single_file(cls, pretrained_model_link_or_path, **kwargs):
189189
revision (`str`, *optional*, defaults to `"main"`):
190190
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
191191
allowed by Git.
192+
original_config_file (`str`, *optional*):
193+
The path to the original config file that was used to train the model. If not provided, the config file
194+
will be inferred from the checkpoint file.
195+
model_type (`str`, *optional*):
196+
The type of model to load. If not provided, the model type will be inferred from the checkpoint file.
197+
image_size (`int`, *optional*):
198+
The size of the image output. It's used to configure the `sample_size` parameter of the UNet and VAE model.
199+
load_safety_checker (`bool`, *optional*, defaults to `False`):
200+
Whether to load the safety checker model or not. By default, the safety checker is not loaded unless a `safety_checker` component is passed to the `kwargs`.
201+
num_in_channels (`int`, *optional*):
202+
Specify the number of input channels for the UNet model. Read more about how to configure UNet model with this parameter
203+
[here](https://huggingface.co/docs/diffusers/training/adapt_a_model#configure-unet2dconditionmodel-parameters).
204+
scaling_factor (`float`, *optional*):
205+
The scaling factor to use for the VAE model. If not provided, it is inferred from the config file first.
206+
If the scaling factor is not found in the config file, the default value 0.18215 is used.
207+
scheduler_type (`str`, *optional*):
208+
The type of scheduler to load. If not provided, the scheduler type will be inferred from the checkpoint file.
209+
prediction_type (`str`, *optional*):
210+
The type of prediction to load. If not provided, the prediction type will be inferred from the checkpoint file.
211+
kwargs (remaining dictionary of keyword arguments, *optional*):
212+
Can be used to overwrite load and saveable variables (the pipeline components of the specific pipeline
213+
class). The overwritten components are passed directly to the pipelines `__init__` method. See example
214+
below for more information.
215+
192216
Examples:
193217
194218
```py

0 commit comments

Comments
 (0)