my code is
!pip install -q --upgrade huggingface_hub
!pip install -q diffusers==0.25.0 accelerate omegaconf xformers transformers gradio==3.48.0 mediapy scipy fastapi==0.103.2
import mediapy as media
import random
import sys
import torch
import os
from diffusers import DiffusionPipeline
import gradio as gr
model = "digiplay/RealEpicMajicRevolution_v1"
pipe = DiffusionPipeline.from_pretrained(
model,
torch_dtype=torch.float16,
requires_safety_checker=None,
)
pipe = pipe.to('cuda')
def txt2img(prompt, negative_prompt, guidance_scale, num_inference_steps, height, width):
image = pipe(prompt, negative_prompt, guidance_scale=guidance_scale, num_inference_steps=num_inference_steps, height=height, width=width).images[0]
image.save("sd_image.png")
return image
with gr.Blocks() as demo:
gr.Markdown("Stable Diffusion")
with gr.Tab("Txt2Img"):
with gr.Row():
with gr.Column(scale=1):
prompt = gr.Textbox(label="Prompt")
negative_prompt = gr.Textbox(label="Negative Prompt")
guidance_scale = gr.Slider(1, 10, value=5, step=0.1, label="Guidance Scale")
num_inference_steps = gr.Slider(1, 100, value=10, step=1, label="Steps")
height = gr.Number(label="Height")
width = gr.Number(label="Width")
with gr.Column(scale=2):
image_output = gr.Image()
generate = gr.Button("Generate")
generate.click(fn=txt2img, inputs=[prompt, negative_prompt, guidance_scale, num_inference_steps, height, width], outputs=image_output)
demo.launch(share=True, debug=True)```
and the error i keep getting is
``` Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 534, in predict
output = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 226, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1550, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1185, in call_function
prediction = await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 661, in wrapper
response = f(*args, **kwargs)
File "<ipython-input-57-a04c60335fb8>", line 20, in txt2img
image = pipe(prompt, negative_prompt, guidance_scale=guidance_scale, num_inference_steps=num_inference_steps, height=height, width=width).images[0]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
TypeError: StableDiffusionPipeline.__call__() got multiple values for argument 'height' ```