Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error doing Textdiffuser2 inpainting demo #1617

Open
1 of 2 tasks
HERIUN opened this issue Aug 30, 2024 · 3 comments
Open
1 of 2 tasks

Error doing Textdiffuser2 inpainting demo #1617

HERIUN opened this issue Aug 30, 2024 · 3 comments

Comments

@HERIUN
Copy link

HERIUN commented Aug 30, 2024

Describe the bug
Model I am using : Textdiffuser2

The problem arises when using:

  • the official example scripts: (give details below)
  • my own modified scripts: (give details below)

A clear and concise description of what the bug is.

demo_textdiffuser2_inpainting_full.py

doesn't work. huggingface link not exists.

and

def get_conversation_template()
m1_tokenizer, m1_model no exists

@Ace0001
Copy link

Ace0001 commented Sep 16, 2024

Hi, have you solved the problem?

@ec-lp
Copy link

ec-lp commented Oct 30, 2024

Hi. I am having similar problem. Has anyone got a simple example that works, not necessarily using gradio?

@HERIUN
Copy link
Author

HERIUN commented Oct 31, 2024

I didn't try, but i will... edit demo_textdiffuser2_inpainting_full.py

add

from fastchat.model import get_conversation_template
from transformers import CLIPTextModel, CLIPTokenizer, AutoTokenizer, AutoModelForCausalLM

m1_model_path = "JingyeChen22/textdiffuser2_layout_planner"
cache_dir = "model_cache"
local_files_only = True  # set to True if the models are saved in cache_dir
m1_tokenizer = AutoTokenizer.from_pretrained(
            m1_model_path,
            use_fast=False,
            cache_dir=cache_dir,
            local_files_only=local_files_only,
        )
m1_model = AutoModelForCausalLM.from_pretrained(
            m1_model_path,
            torch_dtype=torch.float16,
            low_cpu_mem_usage=True,
            cache_dir=cache_dir,
            local_files_only=local_files_only,
        ).cuda()

replace
runwayml/stable-diffusion-v1-5 -> stable-diffusion-v1-5/stable-diffusion-v1-5

and font path edit
./Arial.ttf -> ./assets/arial.ttf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants