55 """
56 self.model = model
57
58 def draw(self, http_client: requests.Session, negative_prompt: str, prompt: str) -> GenerationResult: 59 """
60 Generates art from the provided prompt and negative prompt.
61
82 json_response = response.json()
83 duration = time.monotonic() - start
84 images = [f"https://img.craiyon.com/{path}" for path in json_response["images"]]
85 return CraiyonAPI.GenerationResult(images, json_response["next_prompt"], duration) 86
87 def search(self, http_client: requests.Session, text: str) -> List[Tuple[str, str]]:
88 """
105 except requests.exceptions.HTTPError as error:
106 raise ValueError(f"An error occurred: {error}")
107 results = response.json()
108 images = [(f"https://img.craiyon.com/{path}", description) for path, description in results]109 return images
Line length greater than configured max_line_length
detected, defaults to 79 character. This limit can be configured docs