Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -151,12 +151,13 @@ def generate_image(
|
|
151 |
|
152 |
img = Image.fromarray((127.5 * (x + 1.0)).cpu().byte().numpy())
|
153 |
nsfw_score = [x["score"] for x in flux_generator.nsfw_classifier(img) if x["label"] == "nsfw"][0]
|
154 |
-
if nsfw_score < NSFW_THRESHOLD:
|
155 |
-
return img, str(opts.seed), flux_generator.pulid_model.debug_img_list
|
156 |
-
else:
|
157 |
-
return (None, f"Your generated image may contain NSFW (with nsfw_score: {nsfw_score}) content",
|
158 |
-
|
159 |
-
|
|
|
160 |
_HEADER_ = '''
|
161 |
<div style="text-align: center; max-width: 650px; margin: 0 auto;">
|
162 |
<h1 style="font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; display: contents;">PuLID for FLUX</h1>
|
|
|
151 |
|
152 |
img = Image.fromarray((127.5 * (x + 1.0)).cpu().byte().numpy())
|
153 |
nsfw_score = [x["score"] for x in flux_generator.nsfw_classifier(img) if x["label"] == "nsfw"][0]
|
154 |
+
#if nsfw_score < NSFW_THRESHOLD:
|
155 |
+
#return img, str(opts.seed), flux_generator.pulid_model.debug_img_list
|
156 |
+
#else:
|
157 |
+
#return (None, f"Your generated image may contain NSFW (with nsfw_score: {nsfw_score}) content",
|
158 |
+
# flux_generator.pulid_model.debug_img_list)
|
159 |
+
|
160 |
+
return output
|
161 |
_HEADER_ = '''
|
162 |
<div style="text-align: center; max-width: 650px; margin: 0 auto;">
|
163 |
<h1 style="font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; display: contents;">PuLID for FLUX</h1>
|