Spaces:
Running
on
Zero
Running
on
Zero
change to numpy
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import re
|
|
| 4 |
from PIL import Image
|
| 5 |
import flux1_inpaint
|
| 6 |
import os
|
|
|
|
| 7 |
|
| 8 |
def sanitize_prompt(prompt):
|
| 9 |
# Allow only alphanumeric characters, spaces, and basic punctuation
|
|
@@ -49,7 +50,8 @@ def example_out(image,image_mask,prompt,strength,example_id):
|
|
| 49 |
#base,ext = os.path.splitext(file)
|
| 50 |
#key = base.split("_")[0]
|
| 51 |
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
css="""
|
| 55 |
#col-left {
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
import flux1_inpaint
|
| 6 |
import os
|
| 7 |
+
import numpy as np
|
| 8 |
|
| 9 |
def sanitize_prompt(prompt):
|
| 10 |
# Allow only alphanumeric characters, spaces, and basic punctuation
|
|
|
|
| 50 |
#base,ext = os.path.splitext(file)
|
| 51 |
#key = base.split("_")[0]
|
| 52 |
|
| 53 |
+
loaded_image = Image.open(f"images/{example_id}.jpg")
|
| 54 |
+
return np.array(loaded_image)
|
| 55 |
|
| 56 |
css="""
|
| 57 |
#col-left {
|