Upload app.py
Browse files
app.py
CHANGED
|
@@ -57,6 +57,10 @@ pipe_i2i = AutoPipelineForImage2Image.from_pretrained(base_model,
|
|
| 57 |
torch_dtype=dtype
|
| 58 |
)
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
MAX_SEED = 2**32-1
|
| 61 |
|
| 62 |
pipe.flux_pipe_call_that_returns_an_iterable_of_images = flux_pipe_call_that_returns_an_iterable_of_images.__get__(pipe)
|
|
@@ -289,7 +293,7 @@ css = '''
|
|
| 289 |
font=[gr.themes.GoogleFont("Source Sans Pro"), "Arial", "sans-serif"]
|
| 290 |
with gr.Blocks(theme=gr.themes.Soft(font=font), css=css, delete_cache=(60, 60)) as app:
|
| 291 |
title = gr.HTML(
|
| 292 |
-
"""<h1><img src="https://huggingface.co/spaces/multimodalart/flux-lora-the-explorer/resolve/main/flux_lora.png" alt="LoRA"> FLUX LoRA
|
| 293 |
elem_id="title",
|
| 294 |
)
|
| 295 |
selected_index = gr.State(None)
|
|
|
|
| 57 |
torch_dtype=dtype
|
| 58 |
)
|
| 59 |
|
| 60 |
+
# Disable the safety (censor) mechanism
|
| 61 |
+
pipe.safety_checker = lambda images, clip_input, **kwargs: (images, False)
|
| 62 |
+
pipe_i2i.safety_checker = lambda images, clip_input, **kwargs: (images, False)
|
| 63 |
+
|
| 64 |
MAX_SEED = 2**32-1
|
| 65 |
|
| 66 |
pipe.flux_pipe_call_that_returns_an_iterable_of_images = flux_pipe_call_that_returns_an_iterable_of_images.__get__(pipe)
|
|
|
|
| 293 |
font=[gr.themes.GoogleFont("Source Sans Pro"), "Arial", "sans-serif"]
|
| 294 |
with gr.Blocks(theme=gr.themes.Soft(font=font), css=css, delete_cache=(60, 60)) as app:
|
| 295 |
title = gr.HTML(
|
| 296 |
+
"""<h1><img src="https://huggingface.co/spaces/multimodalart/flux-lora-the-explorer/resolve/main/flux_lora.png" alt="LoRA"> FLUX LoRA Kayte's Space</h1>""",
|
| 297 |
elem_id="title",
|
| 298 |
)
|
| 299 |
selected_index = gr.State(None)
|