Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thismodernday/comfyui-instructorollama
Custom comfyui https://github.com/comfyanonymous/ComfyUI Nodes for interacting with Ollama https://ollama.com/ using the Instructor https://github.com/jxnl/instructor Library to provide structured output from your LLM
https://github.com/thismodernday/comfyui-instructorollama
comfyui comfyui-nodes instructor llm ollama
Last synced: about 1 month ago
JSON representation
Custom comfyui https://github.com/comfyanonymous/ComfyUI Nodes for interacting with Ollama https://ollama.com/ using the Instructor https://github.com/jxnl/instructor Library to provide structured output from your LLM
- Host: GitHub
- URL: https://github.com/thismodernday/comfyui-instructorollama
- Owner: ThisModernDay
- License: apache-2.0
- Created: 2024-08-19T18:30:41.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-08-20T00:30:24.000Z (3 months ago)
- Last Synced: 2024-10-10T18:41:52.913Z (about 1 month ago)
- Topics: comfyui, comfyui-nodes, instructor, llm, ollama
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ComfyUI Instructor Ollama
Custom [ComfyUI](https://github.com/comfyanonymous/ComfyUI) Nodes for interacting with [Ollama](https://ollama.com/) using the [Instructor](https://github.com/jxnl/instructor). Library to provide structured output from your LLM
To use this properly, you would need a running Ollama server reachable from the host that is running ComfyUI.
## Installation
1. git clone into the ```custom_nodes``` folder inside your ComfyUI installation or download as zip and unzip the contents to ```custom_nodes/ComfyUI-InstructorOllama```.
2. `pip install -r requirements.txt`
3. Start/restart ComfyUI## Nodes
Ollama Instructor Node
![](.images/oin.png)
This is currently the only node in this pack. More will be added in the future
**Response models**
--
These are the pydantic models they are found in your custom nodes folder under`ComfyUI-InstructorOllama/models`
I have included 4 examples in the models folder.
The way the node currently works it looks for the python file in the folder (this allows you to create new models refresh the page to hotload the new models in)
### Example Pydantic Model
```Python
from pydantic import BaseModel, Fieldclass User(BaseModel):
first_name: str
last_name: str
email: str
phone: str
address: strclass Users(BaseModel):
users: List[User]
```The file name must match the class of the pydantic model you are wanting to use so in the example above the file in the models folder is called `Users.py`
I strongly suggest reading up on pydantic models before starting with this node.