Spaces:
Running
Running
Commit
•
375bdeb
1
Parent(s):
9325867
Handles HEIC
Browse files
app.py
CHANGED
@@ -8,8 +8,11 @@ import spaces
|
|
8 |
|
9 |
from diffusers import StableDiffusionXLInpaintPipeline
|
10 |
from PIL import Image, ImageFilter
|
|
|
11 |
|
12 |
-
|
|
|
|
|
13 |
|
14 |
if torch.cuda.is_available():
|
15 |
device = "cuda"
|
@@ -355,7 +358,7 @@ with gr.Blocks() as interface:
|
|
355 |
negative_prompt = gr.Textbox(label = "Negative prompt", placeholder = "Describe what you do NOT want to see in the entire image", value = 'Border, frame, painting, scribbling, smear, noise, blur, watermark')
|
356 |
smooth_border = gr.Slider(minimum = 0, maximum = 1024, value = 0, step = 2, label = "Smooth border", info = "lower=preserve original, higher=seamless")
|
357 |
num_inference_steps = gr.Slider(minimum = 10, maximum = 100, value = 50, step = 1, label = "Number of inference steps", info = "lower=faster, higher=image quality")
|
358 |
-
guidance_scale = gr.Slider(minimum = 1, maximum = 13, value = 7, step = 0.1, label = "
|
359 |
image_guidance_scale = gr.Slider(minimum = 1, value = 1.5, step = 0.1, label = "Image Guidance Scale", info = "lower=image quality, higher=follow the image")
|
360 |
strength = gr.Slider(value = 0.99, minimum = 0.01, maximum = 1.0, step = 0.01, label = "Strength", info = "lower=follow the original area (discouraged), higher=redraw from scratch")
|
361 |
denoising_steps = gr.Number(minimum = 0, value = 1000, step = 1, label = "Denoising", info = "lower=irrelevant result, higher=relevant result")
|
|
|
8 |
|
9 |
from diffusers import StableDiffusionXLInpaintPipeline
|
10 |
from PIL import Image, ImageFilter
|
11 |
+
from pillow_heif import register_heif_opener
|
12 |
|
13 |
+
register_heif_opener()
|
14 |
+
|
15 |
+
max_64_bit_int = np.iinfo(np.int32).max
|
16 |
|
17 |
if torch.cuda.is_available():
|
18 |
device = "cuda"
|
|
|
358 |
negative_prompt = gr.Textbox(label = "Negative prompt", placeholder = "Describe what you do NOT want to see in the entire image", value = 'Border, frame, painting, scribbling, smear, noise, blur, watermark')
|
359 |
smooth_border = gr.Slider(minimum = 0, maximum = 1024, value = 0, step = 2, label = "Smooth border", info = "lower=preserve original, higher=seamless")
|
360 |
num_inference_steps = gr.Slider(minimum = 10, maximum = 100, value = 50, step = 1, label = "Number of inference steps", info = "lower=faster, higher=image quality")
|
361 |
+
guidance_scale = gr.Slider(minimum = 1, maximum = 13, value = 7, step = 0.1, label = "Guidance Scale", info = "lower=image quality, higher=follow the prompt")
|
362 |
image_guidance_scale = gr.Slider(minimum = 1, value = 1.5, step = 0.1, label = "Image Guidance Scale", info = "lower=image quality, higher=follow the image")
|
363 |
strength = gr.Slider(value = 0.99, minimum = 0.01, maximum = 1.0, step = 0.01, label = "Strength", info = "lower=follow the original area (discouraged), higher=redraw from scratch")
|
364 |
denoising_steps = gr.Number(minimum = 0, value = 1000, step = 1, label = "Denoising", info = "lower=irrelevant result, higher=relevant result")
|