Collaborative Distributed Diffusion-Based AI-Generated Content (AIGC)

Hongyang Du, Ruichen Zhang, Dusit Niyato, Jiawen Kang, Zehui Xiong, Shuguang Cui, Xuemin Shen, Dong In Kim
Nanyang Technological University

Abstract

Driven by advances in generative artificial intelligence (AI) techniques and algorithms, the widespread adoption of AI-generated content (AIGC) has emerged, allowing for the generation of diverse and high-quality content. Especially, the diffusion model-based AIGC technique has been widely used to generate content in a variety of modalities. However, the real-world implementation of AIGC models, particularly on resource-constrained devices such as mobile phones, introduces significant challenges related to energy consumption and privacy concerns. To further promote the realization of ubiquitous AIGC services, we propose a novel collaborative distributed diffusion-based AIGC framework. By capitalizing on collaboration among devices in wireless networks, the proposed framework facilitates the efficient execution of AIGC tasks, optimizing edge computation resource utilization. Furthermore, we examine the practical implementation of the denoising steps on mobile phones, the impact of the proposed approach on the wireless network-aided AIGC landscape, and the future opportunities associated with its real-world integration. The contributions of this paper not only offer a promising solution to the existing limitations of AIGC services but also pave the way for future research in device collaboration, resource optimization, and the seamless delivery of AIGC services across various devices.

๐Ÿ”ง Environment Setup

To create a new conda environment, run the following command:

conda create --name disdiff python==3.9

โšก Activate Environment

Activate the created environment with:

conda activate disdiff

๐Ÿ“ฆ Install Required Packages

You need to install the following packages using pip:

pip install diffusers==0.13.1
pip install torch==2.0.1
pip install transformers==4.29.2
pip install accelerate==0.20.0

๐Ÿ” Locate StableDiffusionPipeline

Open offloading.py in your code editor. Use ctrl (Windows) or command (Mac) and click StableDiffusionPipeline to navigate to pipeline_stable_diffusion.py.

Location of StableDiffusionPipeline

To find this file in your directory, right-click the filename and select 'open in' -> 'finder'.

File in Directory

๐Ÿ”„ Replace with Project File

Replace pipeline_stable_diffusion.py with the file of the same name from this repository.

Replace `pipeline_stable_diffusion.py`

๐Ÿƒโ€โ™€๏ธ Run the Program

Finally, run offloading.py to start the program. The model will be downloaded automatically if you are running this code for the first time.

Download Automatically

๐Ÿ” Check the results

The parameter "tt" is the offloading processing point, and the parameter "ss" is the total denoising steps. For more details, please check the offloading.py.

Results

BibTeX

@article{du2023exploring,
  title={Exploring collaborative distributed diffusion-based AI-generated content (AIGC) in wireless networks},
  author={Du, Hongyang and Zhang, Ruichen and Niyato, Dusit and Kang, Jiawen and Xiong, Zehui and Kim, Dong In and Shen, Xuemin Sherman and Poor, H Vincent},
  journal={IEEE Network},
  number={99},
  pages={1--8},
  year={2023},
  publisher={IEEE}
}

BibTeX

@article{du2023user,
  title={User-Centric Interactive AI for Distributed Diffusion Model-based AI-Generated Content},
  author={Du, Hongyang and Zhang, Ruichen and Niyato, Dusit and Kang, Jiawen and Xiong, Zehui and Cui, Shuguang and Shen, Xuemin and Kim, Dong In},
  journal={arXiv preprint arXiv:2311.11094},
  year={2023}
}