Surajr45 commited on
Commit
46a3f8b
·
verified ·
1 Parent(s): 8bed7e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- flux_generator.pulid_model.debug_img_list)
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>