abhishekkrthakur / diffuzers

a web ui & api for 🤗 diffusers
Apache License 2.0
583 stars 88 forks source link

Colab seems not working #31

Open Cloudaig opened 9 months ago

Cloudaig commented 9 months ago

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script exec(code, module.dict) File "/usr/local/lib/python3.10/dist-packages/diffuzers/Home.py", line 7, in from diffuzers.x2image import X2Image File "/usr/local/lib/python3.10/dist-packages/diffuzers/x2image.py", line 14, in from diffusers import ( File "", line 1075, in _handle_fromlist File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/import_utils.py", line 675, in getattr value = getattr(module, name) File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/import_utils.py", line 675, in getattr value = getattr(module, name) File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/import_utils.py", line 674, in getattr module = self._get_module(self._class_to_module[name]) File "/usr/local/lib/python3.10/dist-packages/diffusers/utils/import_utils.py", line 686, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.pipelines.alt_diffusion.pipeline_alt_diffusion_img2img because of the following error (look up to see its traceback): cannot import name 'CpuOffload' from 'accelerate.hooks' (/usr/local/lib/python3.10/dist-packages/accelerate/hooks.py)

wstria commented 9 months ago

I ran into the same error, have you been able to find a away around it yet?

asmossunov commented 8 months ago

I also had such a problem. The accelerate update helped me:

pip install --upgrade accelerate

furkanshaikh313 commented 6 months ago

Can someone help me by telling me how to run API i got 200 response but i dont know how to get images import requests

API endpoint

api_url = "https://new-rings-yawn.loca.lt"

Prompt variable

prompt_text = "blue elephant"

Parameters to be sent with the request

params = { 'prompt': prompt_text

}

Make a GET request with parameters

response = requests.get(api_url, params=params)

Check if the request was successful (status code 200)

if response.status_code == 200:

Print the response content (assuming it returns some data)

print("Response Content:")
print(response.text)

else:

Print an error message if the request was not successful

print(f"Error: {response.status_code} - {response.text}")

C:\Users\HP\Desktop>python -u "c:\Users\HP\Desktop\api.py" Response Content: {"Hello":"World"}

image_2024-01-19_185522685