Fabrice-TIERCELIN
commited on
Commit
•
0d506b5
1
Parent(s):
896a435
Handles HEIC
Browse files
app.py
CHANGED
@@ -8,8 +8,11 @@ import spaces
|
|
8 |
|
9 |
from diffusers import AutoPipelineForImage2Image
|
10 |
from PIL import Image, ImageFilter
|
|
|
11 |
|
12 |
-
|
|
|
|
|
13 |
|
14 |
# Automatic device detection
|
15 |
if torch.cuda.is_available():
|
@@ -209,7 +212,7 @@ with gr.Blocks() as interface:
|
|
209 |
with gr.Accordion("Advanced options", open = False):
|
210 |
negative_prompt = gr.Textbox(label = "Negative prompt", placeholder = "Describe what you do NOT want to see", value = "Ugly, malformed, noise, blur, watermark")
|
211 |
num_inference_steps = gr.Slider(minimum = 10, maximum = 100, value = 25, step = 1, label = "Number of inference steps", info = "lower=faster, higher=image quality")
|
212 |
-
guidance_scale = gr.Slider(minimum = 1, maximum = 13, value = 7, step = 0.1, label = "
|
213 |
image_guidance_scale = gr.Slider(minimum = 1, value = 1.1, step = 0.1, label = "Image Guidance Scale", info = "lower=image quality, higher=follow the image")
|
214 |
denoising_steps = gr.Slider(minimum = 0, maximum = 1000, value = 1000, step = 1, label = "Denoising", info = "lower=irrelevant result, higher=relevant result")
|
215 |
randomize_seed = gr.Checkbox(label = "\U0001F3B2 Randomize seed", value = True, info = "If checked, result is always different")
|
|
|
8 |
|
9 |
from diffusers import AutoPipelineForImage2Image
|
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 |
# Automatic device detection
|
18 |
if torch.cuda.is_available():
|
|
|
212 |
with gr.Accordion("Advanced options", open = False):
|
213 |
negative_prompt = gr.Textbox(label = "Negative prompt", placeholder = "Describe what you do NOT want to see", value = "Ugly, malformed, noise, blur, watermark")
|
214 |
num_inference_steps = gr.Slider(minimum = 10, maximum = 100, value = 25, step = 1, label = "Number of inference steps", info = "lower=faster, higher=image quality")
|
215 |
+
guidance_scale = gr.Slider(minimum = 1, maximum = 13, value = 7, step = 0.1, label = "Guidance Scale", info = "lower=image quality, higher=follow the prompt")
|
216 |
image_guidance_scale = gr.Slider(minimum = 1, value = 1.1, step = 0.1, label = "Image Guidance Scale", info = "lower=image quality, higher=follow the image")
|
217 |
denoising_steps = gr.Slider(minimum = 0, maximum = 1000, value = 1000, step = 1, label = "Denoising", info = "lower=irrelevant result, higher=relevant result")
|
218 |
randomize_seed = gr.Checkbox(label = "\U0001F3B2 Randomize seed", value = True, info = "If checked, result is always different")
|