Skip to content

Commit d3c9d81

Browse files
krampstudiogary149
andauthored
Add gallery component doc (#1093)
* add gallery component doc * wording * Apply suggestions from code review Co-authored-by: Victor Muštar <[email protected]> * dark mode images * Update model-cards-components.md --------- Co-authored-by: Victor Muštar <[email protected]>
1 parent 417d8d6 commit d3c9d81

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docs/hub/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
title: Model Card Guidebook
4747
- local: model-card-landscape-analysis
4848
title: Landscape Analysis
49+
- local: model-cards-components
50+
title: Card Components
4951
- local: models-gated
5052
title: Gated Models
5153
- local: models-uploading

docs/hub/model-cards-components.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Model Card components
2+
3+
**Model Card Components** are special elements that you can inject directly into your Model Card markdown to display powerful custom components in your model page. These components are authored by us, feel free to share ideas about new Model Card component in [this discussion](https://huggingface.co/spaces/huggingchat/chat-ui/discussions/312).
4+
5+
## The Gallery component
6+
7+
Add the `<Gallery />` component to your text-to-image model card to showcase your images generation.
8+
9+
For example,
10+
```md
11+
12+
<Gallery />
13+
14+
## Model description
15+
16+
TintinIA is fine-tuned version of Stable-Diffusion-xl trained on 125 comics panels from Tintin album.
17+
18+
```
19+
20+
21+
<div class="flex justify-center">
22+
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gallery.png"/>
23+
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gallery-dark.png"/>
24+
</div>
25+
26+
The `<Gallery/>` component will use your Model Card [widget metadata](/docs/hub/models-widgets-examples#text-to-image) to display the images with each associated prompt.
27+
28+
```yaml
29+
widget:
30+
- text: "drawing of tintin in a shop"
31+
output:
32+
url: "images/shop.png"
33+
- text: "drawing of tintin watching rugby"
34+
output:
35+
url: "images/rugby.png"
36+
parameters:
37+
negative_prompt: "blurry"
38+
- text: "tintin working at the office"
39+
output:
40+
url: "images/office.png"
41+
```
42+
43+
> Hint: Support of Card Components through the GUI editor coming soon...

0 commit comments

Comments
 (0)