Instructions to use mhnakif/comfy2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use mhnakif/comfy2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("mhnakif/comfy2", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| from pydantic import BaseModel, Field | |
| class SeedVR2ImageRequest(BaseModel): | |
| image: str = Field(...) | |
| target_resolution: str = Field(...) | |
| output_format: str = Field("png") | |
| enable_sync_mode: bool = Field(False) | |
| class FlashVSRRequest(BaseModel): | |
| target_resolution: str = Field(...) | |
| video: str = Field(...) | |
| duration: float = Field(...) | |
| class TaskCreatedDataResponse(BaseModel): | |
| id: str = Field(...) | |
| class TaskCreatedResponse(BaseModel): | |
| code: int = Field(...) | |
| message: str = Field(...) | |
| data: TaskCreatedDataResponse | None = Field(None) | |
| class TaskResultDataResponse(BaseModel): | |
| status: str = Field(...) | |
| outputs: list[str] = Field([]) | |
| class TaskResultResponse(BaseModel): | |
| code: int = Field(...) | |
| message: str = Field(...) | |
| data: TaskResultDataResponse | None = Field(None) | |