kayte0342 commited on
Commit
d68503b
·
verified ·
1 Parent(s): 248d6f9

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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 the Explorer</h1>""",
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)