CivArchive
    SD3 Medium Slightly Decensored (Perturbed) - 1% (no clips)
    NSFW
    Preview 15790307
    Preview 15788403
    Preview 15788033

    credits to Thyri

    Perturbed Version of SD3 using script (replace input and output location)

    1. download sd3 from huggingface

    2. put script in a .py (replace input with sd3 model location and output location with where and what you want to name it). modify 0.01 to how much you want it to be perturbed (0.01 = 1%)

    3. execute the .py using "python your_py_script.py" (maybe you need to activate your virtual environment)


    import torch

    from safetensors.torch import load_file, save_file

    # Load the safetensors model

    model = load_file('__INPUT LOCATION__')

    # Extract the keys and tensors

    keys = model.keys()

    dic = {key: model[key] for key in keys}

    # Define parts to filter

    parts = ['diffusion_model']

    count = 0

    # Perturb the specified parts

    for k in keys:

    if all(part in k for part in parts):

    v = dic[k]

    print(f'{k}: {v.std()}')

    dic[k] += torch.normal(torch.zeros_like(v), v.std() * 0.01)

    count += 1

    print(f'Total perturbed tensors: {count}')

    # Save the perturbed model

    save_file(dic, '__OUTPUT LOCATION__')

    Description

    FAQ

    Comments (14)

    davchaJun 14, 2024· 8 reactions
    CivitAI

    I'm Thyri.

    oprahJun 14, 2024
    CivitAI

    Doesn't work at all for me. Got this error in ComfyUI:

    Error occurred when executing CLIPTextEncode: 'NoneType' object has no attribute 'tokenize' File "D:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 57, in encode tokens = clip.tokenize(text) ^^^^^^^^^^^^^

    Queue size: 0

    Extra options

    Running

    Pending

    163192Jun 14, 2024· 3 reactions
    CivitAI

    It does seem to reduce body horror and improve the outputs in the limited testing I've done. Moving in the right direction!

    mizoku_azureJun 15, 2024
    CivitAI

    Won't load for me in Swarm UI.

    coyedi5985Jun 15, 2024· 9 reactions
    CivitAI

    I'm not sure if I want to both since the description is one long dick joke.

    4331997Jun 15, 2024
    CivitAI

    Do I need to execute that code? I just have the model itself loaded. If so I don't know how to run that code.

    hapemxgJun 15, 2024· 4 reactions
    CivitAI

    展示图片有点吓人😰

    bankenichiJun 15, 2024· 4 reactions
    CivitAI

    You really are on to something with the perturbed models, Im trying the 2% and it is doing much better than base SD3.

    Keep up the good work!

    HapseJun 15, 2024· 11 reactions
    CivitAI

    dic[k]

    Hehe

    androsynth7610Jun 16, 2024
    CivitAI

    Okay its 2B as well including clips and T5. So there is still a 4B and 8B one around. Its actually "small". Lots of strange chatter going on... i don't know to make heads or tails of it: https://www.reddit.com/r/StableDiffusion/comments/1dhd7vz/the_developer_of_comfy_who_also_helped_train_some/#lightbox I surely would love to get my hands on the 4B

    spammenotinoz190Jun 26, 2024
    CivitAI

    Thank-you, a big improvement, but still quite restrictive.

    JayNLJul 11, 2024
    CivitAI

    I have an unpublished adaptation of SD3 medium, nobody can see it right now, if you archive it, can you unarchive it when Civitai allows SD3 models? 🙏

    user1234123Jul 27, 2024· 1 reaction
    CivitAI

    Ah, now it's clear. A key part I was missing a long dic[k] += torch.normal(torch.zeros_like(v), v.std() * 0.01) it was all about me lacking the longer dic[k] part.

    Does v = dic[k] mean defining a micro_dic[k] part as larger than it is it could still work for this?

    wt_01333Sep 11, 2025
    CivitAI

    umm.. wow! Could you provide just script file for windows commant line or terminal, to activate it and make everything mathematically right?

    Checkpoint
    SD 3

    Details

    Downloads
    358
    Platform
    CivitAI
    Platform Status
    Deleted
    Created
    6/14/2024
    Updated
    4/27/2026
    Deleted
    10/16/2025

    Files

    sd3MediumSlightly_1NoClips.safetensors

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.