Spaces:
Build error
Build error
formatting.
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from hub_utils import push_to_hub, save_model_card
|
|
5 |
|
6 |
PRETRAINED_CKPT = "CompVis/stable-diffusion-v1-4"
|
7 |
DESCRIPTION = """
|
8 |
-
This Space lets you convert KerasCV Stable Diffusion weights to a format compatible with [Diffusers](https://github.com/huggingface/diffusers) 🧨. This allows users to fine-tune using KerasCV and use the fine-tuned weights in Diffusers taking advantage of its nifty features (like schedulers, fast attention, etc.). Specifically, the
|
9 |
|
10 |
## Notes (important)
|
11 |
|
@@ -18,7 +18,7 @@ This Space lets you convert KerasCV Stable Diffusion weights to a format compati
|
|
18 |
* When providing the weights' links, ensure they're directly downloadable. Internally, the Space uses [`tf.keras.utils.get_file()`](https://www.tensorflow.org/api_docs/python/tf/keras/utils/get_file) to retrieve the weights locally.
|
19 |
* If you don't provide `your_hf_token` the converted pipeline won't be pushed.
|
20 |
|
21 |
-
Check [here](https://github.com/huggingface/diffusers/blob/31be42209ddfdb69d9640a777b32e9b5c6259bf0/examples/dreambooth/train_dreambooth_lora.py#L975) for an example on how you can change the scheduler of an already initialized
|
22 |
"""
|
23 |
|
24 |
|
@@ -27,6 +27,7 @@ def run(hf_token, text_encoder_weights, unet_weights, repo_prefix):
|
|
27 |
text_encoder_weights = None
|
28 |
if unet_weights == "":
|
29 |
unet_weights = None
|
|
|
30 |
pipeline = run_conversion(text_encoder_weights, unet_weights)
|
31 |
output_path = "kerascv_sd_diffusers_pipeline"
|
32 |
pipeline.save_pretrained(output_path)
|
|
|
5 |
|
6 |
PRETRAINED_CKPT = "CompVis/stable-diffusion-v1-4"
|
7 |
DESCRIPTION = """
|
8 |
+
This Space lets you convert KerasCV Stable Diffusion weights to a format compatible with [Diffusers](https://github.com/huggingface/diffusers) 🧨. This allows users to fine-tune using KerasCV and use the fine-tuned weights in Diffusers taking advantage of its nifty features (like [schedulers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/schedulers), [fast attention](https://huggingface.co/docs/diffusers/optimization/fp16), etc.). Specifically, the Keras weights are first converted to PyTorch and then they are wrapped into a [`StableDiffusionPipeline`](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/overview). This pipeline is then pushed to the Hugging Face Hub given you have provided `your_hf_token`.
|
9 |
|
10 |
## Notes (important)
|
11 |
|
|
|
18 |
* When providing the weights' links, ensure they're directly downloadable. Internally, the Space uses [`tf.keras.utils.get_file()`](https://www.tensorflow.org/api_docs/python/tf/keras/utils/get_file) to retrieve the weights locally.
|
19 |
* If you don't provide `your_hf_token` the converted pipeline won't be pushed.
|
20 |
|
21 |
+
Check [here](https://github.com/huggingface/diffusers/blob/31be42209ddfdb69d9640a777b32e9b5c6259bf0/examples/dreambooth/train_dreambooth_lora.py#L975) for an example on how you can change the scheduler of an already initialized `StableDiffusionPipeline`.
|
22 |
"""
|
23 |
|
24 |
|
|
|
27 |
text_encoder_weights = None
|
28 |
if unet_weights == "":
|
29 |
unet_weights = None
|
30 |
+
print(f"unet_weights: {unet_weights}")
|
31 |
pipeline = run_conversion(text_encoder_weights, unet_weights)
|
32 |
output_path = "kerascv_sd_diffusers_pipeline"
|
33 |
pipeline.save_pretrained(output_path)
|