Skip to content

Commit

Permalink
Convert RGBA inputs to RGB
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis committed Nov 22, 2023
1 parent 301e77d commit d7ffcb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Follow the [model pushing guide](https://replicate.com/docs/guides/push-a-model)

Download weights first

cog run python script/download_weights.py
cog run script/download-weights

Then for predictions,

Expand Down
Binary file removed output.mp4
Binary file not shown.
7 changes: 7 additions & 0 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import yaml
import torch
sys.path.extend(['/SEINE'])
from PIL import Image
import subprocess

class Predictor(BasePredictor):
Expand Down Expand Up @@ -50,6 +51,12 @@ def predict(
if seed is None:
seed = int.from_bytes(os.urandom(2), "big")
print(f"Using seed: {seed}")

img = Image.open(image)
if img.mode == "RGBA":
img = img.convert("RGB")
image = "/tmp/input.jpg"
img.save(image)

# Clean up past runs (just in case)
os.system("rm -rf /src/results/")
Expand Down

0 comments on commit d7ffcb2

Please sign in to comment.