Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/huan085128/Gather-and-Bind
07 February 2025, 11:51:28 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 8862dd3
  • /
  • README.md
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:1ec99bd39199cbea136b444fe121a4e323059fb5
origin badgedirectory badge
swh:1:dir:8862dd3652cf95ad66334b6ab2aee89b68617f27
origin badgerevision badge
swh:1:rev:de045e02ef1014e36fb9ecf4882d6efd5d266415
origin badgesnapshot badge
swh:1:snp:d0cb33e9cd58befa97b803328695a51de205e96f

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: de045e02ef1014e36fb9ecf4882d6efd5d266415 authored by 傅欢 on 07 February 2025, 07:49:42 UTC
update readme
Tip revision: de045e0
README.md
# Enhancing Semantic Mapping in Text-to-Image Diffusion via Gather-and-Bind

This repo is the official PyTorch implementation of [Gather-and-Bind](https://doi.org/10.1016/j.cag.2024.104118).

![Local Image](./images/4.png)

## Project Introduction

Gather-and-Bind is an optimization algorithm for stable diffusion, specifically designed to enhance the quality of generated images to make them align better with the given prompts.

<div style="display: flex; justify-content: center;">
    <div style="margin-right: 20px;">
        <img src="images/3.png" width="400" alt="Image 1">
    </div>
    <div>
        <img src="images/2.png" width="400" alt="Image 2">
    </div>
</div>

![Gather-and-Bind](images/1.png)

## Get Start

### Step-1 installation
To set up and run this project, please ensure the following requirements are met:
- Conda is mandatory: The installation and environment setup rely on Conda. Please install Miniconda or Anaconda if you haven’t already.
- Hardware requirements: A GPU with at least 24GB VRAM is recommended to run the model efficiently. 

```bash
# clone the repository
git clone https://github.com/huan085128/Gather-and-Bind

# install environment
./install.sh
```
if you can't download en_core_web_trf, you can download it manually from [here](https://drive.google.com/drive/folders/1A_66w8pqR9JnZxpy4Pz1Eyuh1IH4I4Zu?usp=sharing) and then install it with the following command:

```bash
python install en_core_web_trf-3.7.3.tar.gz
```

### Step-2 download pretrained model
Download the stable_diffusion_v1.5 model from [here](https://drive.google.com/drive/folders/1A_66w8pqR9JnZxpy4Pz1Eyuh1IH4I4Zu?usp=sharing)

and then put the model in the models directory.

### Step-3 generate images

```bash
# run the following command to generate images
python generate_images.py
```

### Step-4 visualizing attention maps with jupyter notebook

As part of the experiments in our paper, we provide a Jupyter Notebook that visualizes the changes in attention maps during the denoising process of the diffusion model. This notebook allows for a more intuitive understanding of how the model focuses on different parts. 

please see the `explain.ipynb` file for more details.

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API