{"id":19074057,"url":"https://github.com/zer0int/clip-generative-adversarial","last_synced_at":"2026-06-20T15:32:34.073Z","repository":{"id":250436358,"uuid":"834472855","full_name":"zer0int/CLIP-generative-adversarial","owner":"zer0int","description":"Projected Gradient Descent (PGD), inverted and amplified -\u003e prompt \u0026 generate images with CLIP","archived":false,"fork":false,"pushed_at":"2024-07-28T18:15:11.000Z","size":15104,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"CLIP-vision","last_synced_at":"2025-02-22T04:27:53.448Z","etag":null,"topics":["adversarial","adversarial-attacks","adversarial-examples","ai","clip","generative","generative-ai","pgd","vision-transformer","xai"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zer0int.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-27T11:24:34.000Z","updated_at":"2024-12-14T03:33:10.000Z","dependencies_parsed_at":"2025-02-22T04:36:59.348Z","dependency_job_id":null,"html_url":"https://github.com/zer0int/CLIP-generative-adversarial","commit_stats":null,"previous_names":["zer0int/clip-generative-adversarial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zer0int/CLIP-generative-adversarial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0int%2FCLIP-generative-adversarial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0int%2FCLIP-generative-adversarial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0int%2FCLIP-generative-adversarial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0int%2FCLIP-generative-adversarial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zer0int","download_url":"https://codeload.github.com/zer0int/CLIP-generative-adversarial/tar.gz/refs/heads/CLIP-vision","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zer0int%2FCLIP-generative-adversarial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34576042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adversarial","adversarial-attacks","adversarial-examples","ai","clip","generative","generative-ai","pgd","vision-transformer","xai"],"created_at":"2024-11-09T01:49:32.972Z","updated_at":"2026-06-20T15:32:34.047Z","avatar_url":"https://github.com/zer0int.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CLIP-generative-adversarial\n### Who needs a Diffusion U-Net or Transformer if you can just use the 'text encoder'...? 😉\n\n![examples](https://github.com/user-attachments/assets/e9d233f6-3690-4ee9-b6ea-52db40e85577)\n\n- Uses Projected Gradient Descent (PGD), which is commonly used in adversarial robustness training\n- Inverts objective and amplifies perturbations for human perception\n- Perturbation towards (!) the prompt by default, making CLIP a self-generative AI 🙃\n- Also plots results 'success' (original vs. perturbated cosine similarity)\n- You can change the default behavior to \"classic\" adversarial example generation\n- See code comments for details and instructions\n------\n- If you ever wondered why some strange word in a prompt for e.g. Stable Diffusion works - now you can find out!\n- For Stable Diffusion V1, the sole text encoder \"guide\" is CLIP ViT-L/14 (the model set by default in my code).\n- The diff between *this* and feature activation max visualization: We're using the whole model (output) to guide towards a text prompt.\n- To visualize indivual 'neurons' (features) in CLIP ViT, see my other repo: [zer0int/CLIP-ViT-visualization](https://github.com/zer0int/CLIP-ViT-visualization)\n- To get a CLIP opinion of what CLIP 'thinks' of an image, see: [zer0int/CLIP-XAI-GUI](https://github.com/zer0int/CLIP-XAI-GUI)\n------\nRequires: torch, torchvision, numpy, PIL, matplotlib, OpenCV, (skimage).\nRequires [OpenAI/CLIP](https://github.com/openai/CLIP).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzer0int%2Fclip-generative-adversarial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzer0int%2Fclip-generative-adversarial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzer0int%2Fclip-generative-adversarial/lists"}