Ver código fonte

fix: the 18+ flag follows nudity, not a low neckline

The rater was asked for a policy word and the pipeline read any answer
above "none" as adult, so a blazer became an 18+ post. Its own reasons say
what it was flagging:

  partial   low-cut blazer revealing cleavage, suggestive fashion pose
  partial   crop top exposes midriff and navel
  partial   dance leotard similar to swimwear, bare legs
  explicit  fully nude figure with visible nipples and genitals

The model was seeing correctly. The rubric put the first three in the same
bucket as the fourth, and the mapping had nothing between safe and 18+.

So the rater now reports what is on the image - nudity, which parts are
bare, whether a sexual act is shown - and the flag is decided from those
facts in one expression that can be read. Cleavage, midriff, bare legs,
swimwear, a leotard, tight clothing and any pose are named in the prompt as
not nudity, because those are exactly what it was flagging. Underwear is
recorded separately and does not currently set the flag; moving that line
is now a one-line change rather than a re-prompt.

Checked against the eight images from recent runs, five clothed and three
nude, through a throwaway workflow using the real node and credential:
eight out of eight, all five clothed now clean, all three nudes still
flagged. The old rubric got four of them wrong.

A missing verdict still means 1. Failing towards the warning is right when
we know nothing, and the node fails the run rather than publishing quietly.

Applied to the live workflow as well as this copy. Already-published posts
keep whatever flag they were given - they are not re-rated by this.
fszontagh 1 mês atrás
pai
commit
a2f2831b24
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      deploy/workflows/35photo2anime-sdcpp.json

+ 4 - 4
deploy/workflows/35photo2anime-sdcpp.json

@@ -688,7 +688,7 @@
           },
           {
             "name": "is_adult",
-            "value": "{{(function(r){if(!r) return 1;if(r.nsfw===true) return 1;var lvl=(r.nsfwLevel||'').toString().toLowerCase();if(lvl && lvl!=='none') return 1;return 0;})($node['Rate The Picture'].json)}}"
+            "value": "{{(function(r){if(!r) return 1;if(r.sexualActivity===true) return 1;var bare=['nipples','genitals','buttocks','pubic_area'];var v=(r.visible||[]).map(function(x){return (x||'').toString().toLowerCase();});for(var i=0;i<v.length;i++) if(bare.indexOf(v[i])>=0) return 1;if((r.nudity||'').toString().toLowerCase()==='full') return 1;if((r.nsfwLevel||'').toString().toLowerCase()==='explicit') return 1;return 0;})($node['Rate The Picture'].json)}}"
           }
         ],
         "inputSource": "fields",
@@ -717,10 +717,10 @@
         "retryDelayMs": 3000,
         "retryMaxDelayMs": 30000,
         "skipOnError": false,
-        "systemPrompt": "You rate a single illustration for a content warning. Reply with ONE raw JSON object and nothing else - no markdown fences, no commentary.\n\n{\"nsfw\": false, \"nsfwLevel\": \"none\", \"reason\": \"fully clothed, no sexual content\"}\n\nRules:\n- Judge THIS image, as drawn. Not what it might imply, not what a similar photograph might show.\n- nsfwLevel: \"none\" when nobody is nude and nothing sexual is shown; \"partial\" for visible underwear, lingerie, swimwear, bare torso or suggestive posing; \"explicit\" for visible genitals, visible nipples, or sexual activity.\n- nsfw: true when nsfwLevel is not \"none\".\n- reason: a short phrase saying what decided it.\n- A stylised or cartoon drawing is judged the same as any other image. Being an illustration does not make it safe.",
+        "systemPrompt": "You report what is visible in one illustration, so that another step can decide whether it needs an 18+ warning. Reply with ONE raw JSON object and nothing else - no markdown fences, no commentary.\n\n{\"nudity\": \"none\", \"visible\": [], \"sexualActivity\": false, \"underwear\": false, \"reason\": \"woman in a blazer, cleavage visible, nothing bare\"}\n\nReport what is drawn, not what it suggests. You are not deciding the warning, so do not lean towards caution - a wrong \"yes\" is as much an error here as a wrong \"no\".\n\n- nudity: \"full\" when a person is naked or all but naked; \"partial\" when one of the parts listed under `visible` is bare; \"none\" otherwise, however tight, short, thin or low-cut the clothing is.\n- visible: any of \"nipples\", \"genitals\", \"buttocks\", \"pubic_area\" - bare skin only, never shape or outline through fabric. Empty array when none are bare.\n- sexualActivity: true only when a sexual act is depicted.\n- underwear: true when underwear or lingerie is the visible outer layer. Recorded, but on its own it is not nudity.\n- reason: a short phrase naming what you actually saw.\n\nNone of the following is nudity. Each one gives nudity \"none\" and an empty `visible`: cleavage, a low or open neckline, a bare midriff or navel, bare arms, bare legs, bare thighs, bare shoulders, a bare back, swimwear, a leotard or bodysuit, tight or thin-looking clothing, and any pose, expression or camera angle however suggestive it seems.\n\nA stylised or cartoon drawing is reported exactly like any other image.",
         "temperature": 0,
         "timeoutMs": 120000,
-        "userPrompt": "Rate this illustration and return the JSON object."
+        "userPrompt": "Report what is visible in this illustration and return the JSON object."
       },
       "id": "node_blog_rate",
       "name": "Rate The Picture",
@@ -745,4 +745,4 @@
       "defaultAccess": "none"
     }
   }
-}
+}