Your task is to review pull requests. Instructions:
- Provide the response in following JSON format: {"reviews": [{"line": <line_number>, "body": "<review comment>"}]}
- Do not give positive comments or compliments.
- Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array.
- Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code.

Review the following code diff in the file "g4f/Provider/nexra/NexraProdiaAI.py" and take the pull request title and description into account when writing the response.
  
Pull request title: [pull] main from xtekky:main
Pull request description:
---
See [Commits](/MeowCollections/gpt4free/pull/107/commits) and [Changes](/MeowCollections/gpt4free/pull/107/files) for more details.

-----
Created by [<img src="https://prod.download/pull-18h-svg" valign="bottom"/> **pull[bot]**](https://github.com/wei/pull)

_Can you help keep this open source service alive? **[💖 Please sponsor : )](https://prod.download/pull-pr-sponsor)**_
---

Each line is prefixed by its number. Code to review:
```
1: from __future__ import annotations
2: 
-from aiohttp import ClientSession
3: import json
-
-from ...typing import AsyncResult, Messages
-from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
4:+import requests
5:+from ...typing import CreateResult, Messages
6:+from ..base_provider import ProviderModelMixin, AbstractProvider
7: from ...image import ImageResponse
8: 
-
-class NexraProdiaAI(AsyncGeneratorProvider, ProviderModelMixin):
9:+class NexraProdiaAI(AbstractProvider, ProviderModelMixin):
10:     label = "Nexra Prodia AI"
11:     url = "https://nexra.aryahcr.cc/documentation/prodia/en"
12:     api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
-    working = False
13:+    working = True
14:     
15:     default_model = 'absolutereality_v181.safetensors [3d9d4d2b]'
16:     models = [
81:         'toonyou_beta6.safetensors [980f6b15]',
82:     ]
83:     
-    model_aliases = {
-    }
84:+    model_aliases = {}
85: 
86:     @classmethod
87:     def get_model(cls, model: str) -> str:
93:             return cls.default_model
94: 
95:     @classmethod
-    async def create_async_generator(
96:+    def get_model(cls, model: str) -> str:
97:+        return cls.default_model
98:+            
99:+    @classmethod
100:+    def create_completion(
101:         cls,
-        model: str, # Select from the list of models
102:+        model: str,
103:         messages: Messages,
104:         proxy: str = None,
105:         response: str = "url", # base64 or url
108:         sampler: str = "DPM++ 2M Karras", # Select from these: "Euler","Euler a","Heun","DPM++ 2M Karras","DPM++ SDE Karras","DDIM"
109:         negative_prompt: str = "", # Indicates what the AI should not do
110:         **kwargs
-    ) -> AsyncResult:
111:+    ) -> CreateResult:
112:         model = cls.get_model(model)
-        
113:+
114:         headers = {
-            "Content-Type": "application/json"
115:+            'Content-Type': 'application/json'
116:         }
-        async with ClientSession(headers=headers) as session:
-            prompt = messages[0]['content']
-            data = {
-                "prompt": prompt,
-                "model": "prodia",
-                "response": response,
-                "data": {
-                    "model": model,
-                    "steps": steps,
-                    "cfg_scale": cfg_scale,
-                    "sampler": sampler,
-                    "negative_prompt": negative_prompt
-                }
117:+        
118:+        data = {
119:+            "prompt": messages[-1]["content"],
120:+            "model": "prodia",
121:+            "response": response,
122:+            "data": {
123:+                "model": model,
124:+                "steps": steps,
125:+                "cfg_scale": cfg_scale,
126:+                "sampler": sampler,
127:+                "negative_prompt": negative_prompt
128:             }
-            async with session.post(cls.api_endpoint, json=data, proxy=proxy) as response:
-                text_data = await response.text()
-                
-                if response.status == 200:
-                    try:
-                        json_start = text_data.find('{')
-                        json_data = text_data[json_start:]
-                        
-                        data = json.loads(json_data)
-                        if 'images' in data and len(data['images']) > 0:
-                            image_url = data['images'][-1]
-                            yield ImageResponse(image_url, prompt)
-                        else:
-                            yield ImageResponse("No images found in the response.", prompt)
-                    except json.JSONDecodeError:
-                        yield ImageResponse("Failed to parse JSON. Response might not be in JSON format.", prompt)
129:+        }
130:+        
131:+        response = requests.post(cls.api_endpoint, headers=headers, json=data)
132:+
133:+        result = cls.process_response(response)
134:+        yield result
135:+
136:+    @classmethod
137:+    def process_response(cls, response):
138:+        if response.status_code == 200:
139:+            try:
140:+                content = response.text.strip()
141:+                content = content.lstrip('_')  # Remove leading underscores
142:+                data = json.loads(content)
143:+                if data.get('status') and data.get('images'):
144:+                    image_url = data['images'][0]
145:+                    return ImageResponse(images=[image_url], alt="Generated Image")
146:                 else:
-                    yield ImageResponse(f"Request failed with status: {response.status}", prompt)
147:+                    return "Error: No image URL found in the response"
148:+            except json.JSONDecodeError as e:
149:+                return f"Error: Unable to decode JSON response. Details: {str(e)}"
150:+        else:
151:+            return f"Error: {response.status_code}, Response: {response.text}"
```