Forward direct generation kwargs in multimodal generation pipelines
Author: Sunt-ing
Pull request: yes

<!-- ci-dashboard-badge:start -->
[![CI](https://transformers-ci.lor-e.huggingface.cool/badge/pr?pr=47051)](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47051)
<!-- ci-dashboard-badge:end -->

# What does this PR do?

`ImageTextToTextPipeline` and `AnyToAnyPipeline` currently special-case `max_new_tokens`, but other direct generation kwargs such as `do_sample`, `temperature`, and `top_p` stay in the preprocessing kwargs. Processors then warn that these are not valid processor arguments and ignore them, so the model never receives the generation settings the user passed.

<details>
<summary>E2E Repro</summary>

```python
from PIL import Image

from transformers import AutoModelForImageTextToText, AutoProcessor, pipeline


model_id = "Xenova/tiny-random-LlavaForConditionalGeneration"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id)
orig_generate = model.generate


def logged_generate(*args, **kwargs):
    print(
        "GENERATE_KWARGS",
        {k: kwargs.get(k) for k in ("do_sample", "temperature", "top_p", "max_new_tokens") if k in kwargs},
    )
    return orig_generate(*args, **kwargs)


model.generate = logged_generate
pipe = pipeline("image-text-to-text", model=model, processor=processor)
img = Image.new("RGB", (8, 8), "white")
out = pipe(
    images=img,
    text="<image> Describe.",
    return_full_text=False,
    max_new_tokens=2,
    do_sample=True,
    temperature=0.7,
    top_p=0.8,
)
print("OUT", out)
```

Before:

```text
[transformers] Keyword argument `do_sample` is not a valid argument for this processor and will be ignored.
[transformers] Keyword argument `temperature` is not a valid argument for this processor and will be ignored.
[transformers] Keyword argument `top_p` is not a valid argument for this processor and will be ignored.
GENERATE_KWARGS {'max_new_tokens': 2}
```

After:

```text
GENERATE_KWARGS {'do_sample': True, 'temperature': 0.7, 'top_p': 0.8, 'max_new_tokens': 2}
```

</details>

This PR moves direct kwargs whose names are part of `GenerationConfig` into `generate_kwargs` for both multimodal generation pipelines. Processor kwargs such as `padding` still stay in preprocessing, and duplicate generation kwargs now raise a clear error instead of having implicit precedence.

Tests:

```text
tests/pipelines/test_pipelines_image_text_to_text.py::ImageTextToTextPipelineTests::test_direct_generation_kwargs_are_forwarded PASSED [ 50%]
tests/pipelines/test_pipelines_image_text_to_text.py::ImageTextToTextPipelineTests::test_direct_generation_kwargs_are_forwarded [PASSED] 0.00s

tests/pipelines/test_pipelines_any_to_any.py::AnyToAnyPipelineSanitizeParametersTests::test_direct_generation_kwargs_are_forwarded PASSED [100%]
tests/pipelines/test_pipelines_any_to_any.py::AnyToAnyPipelineSanitizeParametersTests::test_direct_generation_kwargs_are_forwarded [PASSED] 0.00s

============================== 2 passed in 0.81s ===============================
```

`git diff --check` and `ruff check` pass for the touched files.

## Code Agent Policy

- [x] I confirm that this is not a pure code agent PR.

## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://huggingface.co/docs/transformers/contributing) and the
      [Pull Request](https://huggingface.co/docs/transformers/pr_checks) checks?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes according to the [guidelines](https://github.com/huggingface/transformers/tree/main/docs)?
- [x] Did you write any new necessary [tests](https://huggingface.co/docs/transformers/testing)?

## Who can review?

cc @zucchini-nlp @Rocketknight1

Comments:
Hmm, this is quite different from how the text generation pipeline handles it, right? iirc, text generation passes everything to generation and pops out a few specific processor/tokenizer args. It also catches `max_length`, which can (awkwardly) go to both.

Thanks @Rocketknight1, updated to follow the text-generation split: residual direct kwargs go to generation, processor kwargs stay in preprocessing, and `max_length` goes to both.

<!-- ci-dashboard-recap:start -->

---

### CI recap

**Dashboard:** [View test results in Grafana](https://transformers-ci.lor-e.huggingface.cool/d/pytest-observability-by-pr/pytest-observability-branch?var-pr=47051)
**Latest run:** [28848435097:2](https://github.com/huggingface/transformers/actions/runs/28848435097)
**Result:** `failure` | **Jobs:** 15 | **Tests:** 171,404 | **Failures:** 9 | **Duration:** 11h 45m

<!-- ci-dashboard-recap:end -->

Yeah, the multimodal pipes diverged a bit since we have tons of kwargs for processors, which can't also be inferred simply from processor class 😢 

Ig users have to pass it in structured way like in generation config or as `processing_kwargs` (like the nested kwargs in processor), so we don't have to guess. WDYT @Rocketknight1 ?

Yeah, structured kwargs makes a lot of sense to me! It avoids us writing a mess of heuristics and trying to figure out collisions

I think this makes more sense if handled internally @Sunt-ing , I will take it next week when back from a short vacation

Sounds good, thanks @zucchini-nlp. I'll stop iterating on this PR and leave the structured kwargs path to you.