-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add download script, fix training tab
- Loading branch information
Showing
4 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
__pycache | ||
__pycache__ | ||
.cog | ||
blip-cache | ||
blip-proc-cache | ||
checkpoint | ||
model-cache | ||
swin2sr-cache | ||
temp | ||
temp_in | ||
training_out | ||
output.tar | ||
trained_model.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
|
||
# Run this before you deploy it on replicate | ||
import os | ||
import sys | ||
import torch | ||
from diffusers import StableDiffusionXLPipeline | ||
|
||
# append project directory to path so predict.py can be imported | ||
sys.path.append('.') | ||
from predict import MODEL_NAME, MODEL_CACHE | ||
|
||
# Make cache folders | ||
if not os.path.exists(MODEL_CACHE): | ||
os.makedirs(MODEL_CACHE) | ||
|
||
# SD-XL-Base-1.0 refiner | ||
pipe = StableDiffusionXLPipeline.from_pretrained( | ||
MODEL_NAME, | ||
torch_dtype=torch.float16, | ||
use_safetensors=True, | ||
variant="fp16" | ||
) | ||
|
||
pipe.save_pretrained(MODEL_CACHE, safe_serialization=True) |