mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[GH-ISSUE #351] Ideogram is the first image model with refusals. #189
Labels
No labels
bug
enhancement
enhancement
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
p-e-w/heretic#189
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ph0rk0z on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/351
Apparently ideogram has a refusal "image" that it generates, similar to how LLMs give you an "i cannot". Not sure if the model itself is worth it, but if you are looking for something new and exciting to break, might be interesting to experiment on. It is also a transformer (DiT) and a 9b. The techniques would be similar. First of it's kind so has me curious.
@p-e-w commented on GitHub (Jun 4, 2026):
It might already be sufficient to abliterate the text encoder, depending on where the decision is made. If residuals produced by the text encoder are the information the model uses to differentiate "good" and "bad" inputs, then making the residuals for "bad" inputs resemble those for "good" ones (e.g. with ARA) could remove restrictions.
@kabachuha commented on GitHub (Jun 4, 2026):
Nope, the refusal is inside in the diffusion model itself. If properly aligned (e.g. DPO / KTO, or more advanced online RL methods), diffusion models can theoretically "analyze" the content of the noised image in self-attention and divert the trajectory into the "poisoned" distribution, just as they do when they continue /inpaint the no-text partially noised image.
Diffusion models are harder, if not impossible to decensor without extensive training, because they don't exhibit the single token refusal direction fragility. Even with adversarial DPO, you will need a lot of data to move the distribution away. This applies to diffusion language models as well.
@Ph0rk0z commented on GitHub (Jun 4, 2026):
I thought this is a transformer though and not a regular diffusion model.
@kabachuha commented on GitHub (Jun 4, 2026):
Diffusion model with a transformer backbone
The transformer just processes all the "image tokens" in parallel, similar to the LLM prefill, transforming them into the corrected noise/velocity, and not "printing" it patch by patch autoregressively
@p-e-w commented on GitHub (Jun 4, 2026):
Sure, the refusal happens there, but it might still use the output of the text encoder to decide whether to refuse.
They can theoretically do that, but that doesn't mean this is how refusal works in Ideogram.
@dreamfast commented on GitHub (Jun 5, 2026):
https://huggingface.co/DreamFast/Qwen3-VL-8B-Heretic-1.3.0 Here's an abliterated text encoder, however it wont make much of a difference.
I had experimented and found that by making a custom CLIP encoder you can change the roles, things like assistant or user, to just
assistant \nand it will pass some basic prompts that otherwise are rejected.However even then, it's very sensitive. And the ones that to get through, it's 90% body horror.
The refusal is baked into the DiT. There is more than one refusal mechanism too. Even if the text encoder is good, something during the image generation can trip it up again.
Analyzing different prompts, layers 31 to 33 seem to get the most difference comparing safe vs unsafe prompts.
Something like this would easily be solved with a lora or fine tuning. I might have another crack at it though to see if it's something that can be tuned out.
Some other notes,
https://ideogram.ai/blog/ideogram-4.0/ - using the proper json structure will help with false positives. This model strictly wants JSON in a specific format.
Also the ComfyUI workflow provided was bugged. CFG was set way high.
So there's a few things to consider to get good results.
@Ph0rk0z commented on GitHub (Jun 5, 2026):
What happens if you skip those layers?
@dreamfast commented on GitHub (Jun 5, 2026):
The most safety layer is 33, I had averaged layers 31 and 32 over 33, zero'd 33, replace 33 with layer 33... you get the idea. In all attempts it'd ruin the generation.
I did smaller averages like 0.1 and 0.01 from 32 -> 33, but the safety was still intact.
So yeah. Messing with any of those layers just breaks the image generation. You just get a colored box with swatches pattern. :(
@Ph0rk0z commented on GitHub (Jun 5, 2026):
So it nans? I wouldn't zero them (you're multiplying a lot of shit by 0), isn't there a node that lets you just skip them from the forward pass?
@dreamfast commented on GitHub (Jun 5, 2026):
Maybe yeah. I am still new to all this too, so I was just trying a mix of different things to see what happens.
I didn't know those nodes existed too, so that's cool there's an easier way to just skip layers. I'll try it out when I get a moment.
@p-e-w commented on GitHub (Jun 5, 2026):
Note that the layers that show the strongest residual separation are not necessarily the layers where the refusal decision is made. Indeed, the separation can be understood as indicating that the decision has already happened, which might have been in the blocks of the same layer, or in the preceding layers.
Try modifying a few layers before the layer where you see the clearest separation. Also, try targeting attention blocks and MLPs separately.
@p-e-w commented on GitHub (Jun 5, 2026):
Also, it might be better to slightly modify a few consecutive layers than to strongly modify a single one. With a big intervention, the chance that something important breaks increases.
@Vinay-Umrethe commented on GitHub (Jun 6, 2026):
Tested with a normal Qwen (local), it did generated one without any filter, but view was distant, when told for a close-up it generated that "I cannot" equivalent image filter
@Ph0rk0z commented on GitHub (Jun 7, 2026):
It's uncensored by dumping a 1.005 sigma into the sampling. At least mostly. Sucks at unstructured prompts, like the quality is just bad. Also short prompts. Has limb issues similar to klein but that might be due to me only using the cond model and not giving it enough steps.