Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,12 +2,12 @@ import gradio as gr
|
|
| 2 |
import torch
|
| 3 |
import spaces
|
| 4 |
from diffusers import FluxInpaintPipeline
|
| 5 |
-
from PIL import Image
|
| 6 |
import io
|
| 7 |
import numpy as np
|
| 8 |
|
| 9 |
# Enable loading of truncated images
|
| 10 |
-
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
| 11 |
|
| 12 |
# Initialize the pipeline
|
| 13 |
pipe = FluxInpaintPipeline.from_pretrained(
|
|
@@ -157,8 +157,7 @@ with gr.Blocks() as demo:
|
|
| 157 |
input_image = gr.Image(
|
| 158 |
label="Upload Logo Image",
|
| 159 |
type="pil",
|
| 160 |
-
height=384
|
| 161 |
-
tool=None # Disable editing tools to prevent corruption
|
| 162 |
)
|
| 163 |
prompt_input = gr.Textbox(
|
| 164 |
label="Where should the logo be applied?",
|
|
|
|
| 2 |
import torch
|
| 3 |
import spaces
|
| 4 |
from diffusers import FluxInpaintPipeline
|
| 5 |
+
from PIL import Image #, ImageFile
|
| 6 |
import io
|
| 7 |
import numpy as np
|
| 8 |
|
| 9 |
# Enable loading of truncated images
|
| 10 |
+
# ImageFile.LOAD_TRUNCATED_IMAGES = True
|
| 11 |
|
| 12 |
# Initialize the pipeline
|
| 13 |
pipe = FluxInpaintPipeline.from_pretrained(
|
|
|
|
| 157 |
input_image = gr.Image(
|
| 158 |
label="Upload Logo Image",
|
| 159 |
type="pil",
|
| 160 |
+
height=384
|
|
|
|
| 161 |
)
|
| 162 |
prompt_input = gr.Textbox(
|
| 163 |
label="Where should the logo be applied?",
|