Instructions to use bbbboiwow/cocccck with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bbbboiwow/cocccck with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("bbbboiwow/cocccck", 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"; | |
| import { ComfyWidgets } from "../../../scripts/widgets.js"; | |
| app.registerExtension({ | |
| name: "pysssss.MathExpression", | |
| init() { | |
| const STRING = ComfyWidgets.STRING; | |
| ComfyWidgets.STRING = function (node, inputName, inputData) { | |
| const r = STRING.apply(this, arguments); | |
| r.widget.dynamicPrompts = inputData?.[1].dynamicPrompts; | |
| return r; | |
| }; | |
| }, | |
| beforeRegisterNodeDef(nodeType) { | |
| if (nodeType.comfyClass === "MathExpression|pysssss") { | |
| const onDrawForeground = nodeType.prototype.onDrawForeground; | |
| nodeType.prototype.onNodeCreated = function() { | |
| // These are typed as any to bypass backend validation | |
| // update frontend to restrict types | |
| for(const input of this.inputs) { | |
| input.type = "INT,FLOAT,IMAGE,LATENT"; | |
| } | |
| } | |
| nodeType.prototype.onDrawForeground = function (ctx) { | |
| const r = onDrawForeground?.apply?.(this, arguments); | |
| const v = app.nodeOutputs?.[this.id + ""]; | |
| if (!this.flags.collapsed && v) { | |
| const text = v.value[0] + ""; | |
| ctx.save(); | |
| ctx.font = "bold 12px sans-serif"; | |
| ctx.fillStyle = "dodgerblue"; | |
| const sz = ctx.measureText(text); | |
| ctx.fillText(text, this.size[0] - sz.width - 5, LiteGraph.NODE_SLOT_HEIGHT * 3); | |
| ctx.restore(); | |
| } | |
| return r; | |
| }; | |
| } | |
| }, | |
| }); | |