Views
No views yet
conda create -n onediffusion_env python=3.8 &&
conda activate onediffusion_env &&
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu118 &&
pip install "git+https://github.com/facebookresearch/pytorch3d.git" &&
pip install -r requirements.txtinference.py for more detailed. For text-to-image, you can use below code snipe.import torch
from onediffusion.diffusion.pipelines.onediffusion import OneDiffusionPipeline
device = torch.device('cuda:0')
pipeline = OneDiffusionPipeline.from_pretrained("lehduong/OneDiffusion").to(device=device, dtype=torch.bfloat16)
NEGATIVE_PROMPT = "monochrome, greyscale, low-res, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation"
output = pipeline(
prompt="[[text2image]] A bipedal black cat wearing a huge oversized witch hat, a wizards robe, casting a spell,in an enchanted forest. The scene is filled with fireflies and moss on surrounding rocks and trees",
negative_prompt=NEGATIVE_PROMPT,
num_inference_steps=50,
guidance_scale=4,
height=1024,
width=1024,
)
output.images[0].save('text2image_output.jpg')python gradio_demo.py --captioner molmo # [molmo, llava, disable]disable mode. In this mode, the returned caption is an empty string, but you should still press the Generate Caption button so that the code formats the input text properly. The memory requirement for this mode is $\approx 12$ GB.









1@misc{le2024diffusiongenerate,
2 title={One Diffusion to Generate Them All},
3 author={Duong H. Le and Tuan Pham and Sangho Lee and Christopher Clark and Aniruddha Kembhavi and Stephan Mandt and Ranjay Krishna and Jiasen Lu},
4 year={2024},
5 eprint={2411.16318},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2411.16318},
9}