Model reference · open weights
MangaLineExtraction is an open-weight image model from p1atdev. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | p1atdev |
|---|---|
| Type | Image models |
| Task | Image edit |
| Parameters (lead) | 43M |
| Runs with | transformers |
| Released | 2024-02-21 |
| Popularity | 607 downloads / month |
| Licence | Open weights |
About
The huggingface transformers compatible version of MangaLineExtraction_PyTorch.
Original repo: https://github.com/ljsabc/MangaLineExtraction_PyTorch
from PIL import Image
import torch
from transformers import AutoModel, AutoImageProcessor
REPO_NAME = "p1atdev/MangaLineExtraction-hf"
model = AutoModel.from_pretrained(REPO_NAME, trust_remote_code=True)
processor = AutoImageProcessor.from_pretrained(REPO_NAME, trust_remote_code=True)
image = Image.open("./sample.jpg")
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
outputs = model(inputs.pixel_values)
line_image = Image.fromarray(outputs.pixel_values[0].numpy().astype("uint8"), mode="L")
line_image.save("./line_image.png")
or you can use the pipeline
from transformers import pipeline
pipe = pipeline("image-to-image", model="p1atdev/MangaLineExtraction-hf", trust_remote_code=True)
pipe("sample.jpg")
sample.jpg | Generated line image |
|---|---|
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
BibTeX:
@article{li-2017-deep,
author = {Chengze Li and Xueting Liu and Tien-Tsin Wong},
title = {Deep Extraction of Manga Structural Lines},
journal = {ACM Transactions on Graphics (SIGGRAPH 2017 issue)},
month = {July},
year = {2017},
volume = {36},
number = {4},
pages = {117:1--117:12},
}
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys mangalineextraction for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (mangalineextraction below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/images/generations \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"mangalineextraction","prompt":"a red bicycle","size":"1024x1024"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.