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

How to use inference for multiple prompt? #107

Open
foreverpiano opened this issue Dec 10, 2024 · 4 comments
Open

How to use inference for multiple prompt? #107

foreverpiano opened this issue Dec 10, 2024 · 4 comments

Comments

@foreverpiano
Copy link

I try to use a list of prompts and the predict input is List[str]. But it reported TypeError(f"prompt must be a string, but got {type(prompt)}")

        # ========================================================================
        # Arguments: prompt, new_prompt, negative_prompt
        # ========================================================================
        if not isinstance(prompt, str):
            raise TypeError(f"`prompt` must be a string, but got {type(prompt)}")
        prompt = [prompt.strip()]

        # negative prompt
        if negative_prompt is None or negative_prompt == "":
            negative_prompt = self.default_negative_prompt
        if not isinstance(negative_prompt, str):
            raise TypeError(
                f"`negative_prompt` must be a string, but got {type(negative_prompt)}"
            )
        negative_prompt = [negative_prompt.strip()]

which is opposite to prompt (str or List[str]): The input text.

        """
        Predict the image/video from the given text.

        Args:
            prompt (str or List[str]): The input text.
            kwargs:
                height (int): The height of the output video. Default is 192.
                width (int): The width of the output video. Default is 336.
                video_length (int): The frame number of the output video. Default is 129.
                seed (int or List[str]): The random seed for the generation. Default is a random integer.
                negative_prompt (str or List[str]): The negative text prompt. Default is an empty string.
                guidance_scale (float): The guidance scale for the generation. Default is 6.0.
                num_images_per_prompt (int): The number of images per prompt. Default is 1.
                infer_steps (int): The number of inference steps. Default is 100.
        """
@foreverpiano
Copy link
Author

cc @JacobKong @TianQi-777 @xibosun

@JacobKong
Copy link
Collaborator

Thanks for your attention. We will fix this. You can try to run a single prompt first because more than one prompt will cause an oom error for high resolution using a single 80 G GPU.

@foreverpiano
Copy link
Author

@JacobKong That's great. I suggest we sample from prompt.txt instead of the command line, as it would be easier to run benchmarks like VBench. I'm also curious about what huanyuan's VBench score is.

@gg22mm
Copy link

gg22mm commented Dec 17, 2024

TypeError(f"`` must be a string, but got {type(prompt)}")

我尝试使用提示列表,预测输入是List[str]。但它报告了TypeError(f"提示 must be a string, but got {type(prompt)}")

        # ========================================================================
        # Arguments: prompt, new_prompt, negative_prompt
        # ========================================================================
        if not isinstance(prompt, str):
            raise TypeError(f"`prompt` must be a string, but got {type(prompt)}")
        prompt = [prompt.strip()]

        # negative prompt
        if negative_prompt is None or negative_prompt == "":
            negative_prompt = self.default_negative_prompt
        if not isinstance(negative_prompt, str):
            raise TypeError(
                f"`negative_prompt` must be a string, but got {type(negative_prompt)}"
            )
        negative_prompt = [negative_prompt.strip()]

prompt (str or List[str]): The input text.

这是相反的prompt (str or List[str]): The input text.

        """
        Predict the image/video from the given text.

        Args:
            prompt (str or List[str]): The input text.
            kwargs:
                height (int): The height of the output video. Default is 192.
                width (int): The width of the output video. Default is 336.
                video_length (int): The frame number of the output video. Default is 129.
                seed (int or List[str]): The random seed for the generation. Default is a random integer.
                negative_prompt (str or List[str]): The negative text prompt. Default is an empty string.
                guidance_scale (float): The guidance scale for the generation. Default is 6.0.
                num_images_per_prompt (int): The number of images per prompt. Default is 1.
                infer_steps (int): The number of inference steps. Default is 100.
        """

这个不就是四川熊猫那个吗? ~~ #134

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