How to have custom output size for inference API
I am using the free version of inference API’s with a custom Stable Diffusion model. When trying to use the endpoint, I am unable to figure out how to set a custom size for the output (like how in the pipeline it’s just height=x and width=x)…Is this possible?
2023-02-16T22:22:34Z
Hi@jetpackjules, the Inference API only accepts the prompt parameter such asinputs, and most recently we have also added support fornegative_prompts. If you need access to extra params you can deploy it as a Space or a customInference Endpoints.github.comhuggingface/api-inference-community/blob/main/docker_images/diffusers/app/pipelines/text_to_image.py#L57self.ldm.unet.load_attn_procs(model_id, use_auth_token=os.getenv("HF_API_TOKEN"))if isinstance(self.ldm, (StableDiffusionPipeline, AltDiffusionPipeline)):self.ldm.scheduler = DPMSolverMultistepScheduler.from_config(self.ldm.scheduler.config)def __call__(self, inputs: str, inference_steps=25, negative_prompt=None, **kwargs) -> "Image.Image":"""Args:inputs (:obj:`str`):a string containing some textReturn:A :obj:`PIL.Image` with the raw image representation as PIL."""if kwargs:
2023-02-16T22:30:00Z
Thanks for the quick reply!Does this mean that there is no way to accomplish this for free?
2023-02-16T22:41:09Z
You can try to find a Space with our community granted GPU that has an open API.
2023-02-16T22:48:37Z
Not sure how to do that…Also would it still work with a custom model?