Instructions to use vetak8/My-ComfyUI-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use vetak8/My-ComfyUI-Models with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("vetak8/My-ComfyUI-Models", torch_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
| import { app } from '../../scripts/app.js'; | |
| const _al = Array.isArray([]); | |
| app.registerExtension({ | |
| name: 'Comfy.INSTARAW.DynamicAPINodes', | |
| async beforeRegisterNodeDef(nodeType, nodeData, app) { | |
| if (nodeData.name === 'INSTARAW_APITextToImage' || nodeData.name === 'INSTARAW_APIImageToImage') { | |
| const onNodeCreated = nodeType.prototype.onNodeCreated; | |
| nodeType.prototype.onNodeCreated = function () { | |
| onNodeCreated?.apply(this, arguments); | |
| this.last_model = null; // Cache property | |
| }; | |
| const onDrawForeground = nodeType.prototype.onDrawForeground; | |
| nodeType.prototype.onDrawForeground = function(ctx) { | |
| onDrawForeground?.apply(this, arguments); | |
| const modelInput = this.inputs?.find((i) => i.name === 'model'); | |
| let current_model = null; | |
| if (modelInput && modelInput.link != null) { | |
| const link = app.graph.links[modelInput.link]; | |
| if (link) { | |
| const origin_node = app.graph.getNodeById(link.origin_id); | |
| const origin_widget = origin_node?.widgets.find(w => w.name === 'model'); | |
| if (origin_widget) current_model = origin_widget.value; | |
| } | |
| } | |
| if (this.last_model === current_model) { | |
| return; // No change, do nothing | |
| } | |
| this.last_model = current_model; | |
| const isSeeDream = current_model?.startsWith('SeeDream'); | |
| this.widgets.find(w => w.name === 'width').hidden = !isSeeDream; | |
| this.widgets.find(w => w.name === 'height').hidden = !isSeeDream; | |
| this.widgets.find(w => w.name === 'enable_safety_checker').hidden = !isSeeDream; | |
| const aspectRatioWidget = this.widgets.find(w => w.name === 'aspect_ratio'); | |
| if (aspectRatioWidget) { | |
| aspectRatioWidget.hidden = isSeeDream; | |
| } | |
| this.computeSize(); | |
| this.setDirtyCanvas(true, true); | |
| }; | |
| } | |
| }, | |
| }); |