Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,14 +9,14 @@ from transformers import CLIPTextModel, CLIPTokenizer,T5EncoderModel, T5Tokenize
|
|
9 |
dtype = torch.bfloat16
|
10 |
device = "cuda"
|
11 |
|
12 |
-
bfl_repo = "
|
13 |
-
scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(bfl_repo, subfolder="scheduler", revision="
|
14 |
text_encoder = CLIPTextModel.from_pretrained("openai/clip-vit-large-patch14", torch_dtype=dtype)
|
15 |
tokenizer = CLIPTokenizer.from_pretrained("openai/clip-vit-large-patch14", torch_dtype=dtype)
|
16 |
-
text_encoder_2 = T5EncoderModel.from_pretrained(bfl_repo, subfolder="text_encoder_2", torch_dtype=dtype, revision="
|
17 |
-
tokenizer_2 = T5TokenizerFast.from_pretrained(bfl_repo, subfolder="tokenizer_2", torch_dtype=dtype, revision="
|
18 |
vae = AutoencoderKL.from_pretrained(bfl_repo, subfolder="vae", torch_dtype=dtype, revision="refs/pr/1")
|
19 |
-
transformer = FluxTransformer2DModel.from_pretrained(bfl_repo, subfolder="transformer", torch_dtype=dtype, revision="
|
20 |
|
21 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
22 |
|
@@ -64,9 +64,7 @@ css="""
|
|
64 |
with gr.Blocks(css=css) as demo:
|
65 |
|
66 |
with gr.Column(elem_id="col-container"):
|
67 |
-
gr.Markdown(f"""
|
68 |
-
12B param rectified flow transformer distilled from [FLUX.1 [pro]](https://blackforestlabs.ai/) for 4 step generation
|
69 |
-
[[blog](https://blackforestlabs.ai/2024/07/31/announcing-black-forest-labs/)] [[model](https://huggingface.co/black-forest-labs/FLUX.1-schnell)]
|
70 |
""")
|
71 |
|
72 |
with gr.Row():
|
|
|
9 |
dtype = torch.bfloat16
|
10 |
device = "cuda"
|
11 |
|
12 |
+
bfl_repo = "UnfilteredAI/NSFW-Flux-v1"
|
13 |
+
scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(bfl_repo, subfolder="scheduler", revision="main")
|
14 |
text_encoder = CLIPTextModel.from_pretrained("openai/clip-vit-large-patch14", torch_dtype=dtype)
|
15 |
tokenizer = CLIPTokenizer.from_pretrained("openai/clip-vit-large-patch14", torch_dtype=dtype)
|
16 |
+
text_encoder_2 = T5EncoderModel.from_pretrained(bfl_repo, subfolder="text_encoder_2", torch_dtype=dtype, revision="main")
|
17 |
+
tokenizer_2 = T5TokenizerFast.from_pretrained(bfl_repo, subfolder="tokenizer_2", torch_dtype=dtype, revision="main")
|
18 |
vae = AutoencoderKL.from_pretrained(bfl_repo, subfolder="vae", torch_dtype=dtype, revision="refs/pr/1")
|
19 |
+
transformer = FluxTransformer2DModel.from_pretrained(bfl_repo, subfolder="transformer", torch_dtype=dtype, revision="main")
|
20 |
|
21 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
22 |
|
|
|
64 |
with gr.Blocks(css=css) as demo:
|
65 |
|
66 |
with gr.Column(elem_id="col-container"):
|
67 |
+
gr.Markdown(f"""NSFW-Flux-v1 is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions. Finetuned by UnfilteredAI, this model is designed to produce a wide range of images, including explicit and NSFW (Not Safe For Work) images from textual inputs
|
|
|
|
|
68 |
""")
|
69 |
|
70 |
with gr.Row():
|